5 #include "src/arguments-inl.h" 6 #include "src/counters.h" 7 #include "src/objects-inl.h" 8 #include "src/objects/js-promise.h" 9 #include "src/objects/module.h" 10 #include "src/runtime/runtime-utils.h" 15 RUNTIME_FUNCTION(Runtime_DynamicImportCall) {
16 HandleScope scope(isolate);
17 DCHECK_EQ(2, args.length());
18 CONVERT_ARG_HANDLE_CHECKED(JSFunction,
function, 0);
19 CONVERT_ARG_HANDLE_CHECKED(Object, specifier, 1);
21 Handle<Script> script(Script::cast(function->shared()->script()), isolate);
23 while (script->has_eval_from_shared()) {
25 handle(Script::cast(script->eval_from_shared()->script()), isolate);
28 RETURN_RESULT_OR_FAILURE(
30 isolate->RunHostImportModuleDynamicallyCallback(script, specifier));
33 RUNTIME_FUNCTION(Runtime_GetModuleNamespace) {
34 HandleScope scope(isolate);
35 DCHECK_EQ(1, args.length());
36 CONVERT_SMI_ARG_CHECKED(module_request, 0);
37 Handle<Module> module(isolate->context()->module(), isolate);
38 return *Module::GetModuleNamespace(isolate, module, module_request);
41 RUNTIME_FUNCTION(Runtime_GetImportMetaObject) {
42 HandleScope scope(isolate);
43 DCHECK_EQ(0, args.length());
44 Handle<Module> module(isolate->context()->module(), isolate);
45 return *isolate->RunHostInitializeImportMetaObjectCallback(module);