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

Method import

gjs/module.cpp:240–250  ·  view source on GitHub ↗

Carries out the import operation

Source from the content-addressed store, hash-verified

238
239 // Carries out the import operation
240 GJS_JSAPI_RETURN_CONVENTION
241 static JSObject* import(JSContext* cx, JS::HandleObject importer,
242 JS::HandleId id, const char* name, GFile* file) {
243 JS::RootedObject module(cx, GjsScriptModule::create(cx, name));
244 if (!module ||
245 !priv(module)->define_import(cx, module, importer, id) ||
246 !priv(module)->import_file(cx, module, file))
247 return nullptr;
248
249 return module;
250 }
251
252 GjsScriptModule(GjsScriptModule&) = delete;
253 GjsScriptModule& operator=(GjsScriptModule&) = delete;

Callers

nothing calls this directly

Calls 2

define_importMethod · 0.80
import_fileMethod · 0.80

Tested by

no test coverage detected