MCPcopy Create free account
hub / github.com/GNOME/gjs / gjs_get_native_registry

Function gjs_get_native_registry

gjs/module.cpp:303–309  ·  view source on GitHub ↗

* gjs_get_native_registry: * @global: The JS global object * * Retrieves a global's native registry from the NATIVE_REGISTRY slot. * Registries are JS Map objects created with JS::NewMapObject instead of * GCHashMaps (used elsewhere in GJS) because the objects need to be exposed to * internal JS code and accessed from native C++ code. * * Returns: the native module registry, a JS Map objec

Source from the content-addressed store, hash-verified

301 * Returns: the native module registry, a JS Map object.
302 */
303JSObject* gjs_get_native_registry(JSObject* global) {
304 JS::Value native_registry =
305 gjs_get_global_slot(global, GjsGlobalSlot::NATIVE_REGISTRY);
306
307 g_assert(native_registry.isObject());
308 return &native_registry.toObject();
309}
310
311/**
312 * gjs_get_module_registry:

Callers 3

lookup_namespaceFunction · 0.85
gjs_import_native_moduleFunction · 0.85

Calls 1

gjs_get_global_slotFunction · 0.85

Tested by

no test coverage detected