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

Method define_import

gjs/module.cpp:95–106  ·  view source on GitHub ↗

Defines the empty module as a property on the importer

Source from the content-addressed store, hash-verified

93
94 // Defines the empty module as a property on the importer
95 GJS_JSAPI_RETURN_CONVENTION
96 bool define_import(JSContext* cx, JS::HandleObject module,
97 JS::HandleObject importer, JS::HandleId name) const {
98 if (!JS_DefinePropertyById(cx, importer, name, module,
99 GJS_MODULE_PROP_FLAGS & ~JSPROP_PERMANENT)) {
100 gjs_debug(GJS_DEBUG_IMPORTER, "Failed to define '%s' in importer",
101 m_name.get());
102 return false;
103 }
104
105 return true;
106 }
107
108 // Carries out the actual execution of the module code
109 GJS_JSAPI_RETURN_CONVENTION

Callers 1

importMethod · 0.80

Calls 2

gjs_debugFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected