Skip to content

Instantly share code, notes, and snippets.

@arturovt
Created November 15, 2018 23:04
Show Gist options
  • Save arturovt/f53d6b0f04c26454e343ab36d82d3a96 to your computer and use it in GitHub Desktop.
Save arturovt/f53d6b0f04c26454e343ab36d82d3a96 to your computer and use it in GitHub Desktop.
RUNTIME_FUNCTION(Runtime_DynamicImportCall) {
HandleScope scope(isolate);
DCHECK_EQ(2, args.length());
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
CONVERT_ARG_HANDLE_CHECKED(Object, specifier, 1);
Handle<Script> script(Script::cast(function->shared()->script()), isolate);
while (script->has_eval_from_shared()) {
script = handle(Script::cast(script->eval_from_shared()->script()), isolate);
}
RETURN_RESULT_OR_FAILURE(
isolate,
isolate->RunHostImportModuleDynamicallyCallback(script, specifier)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment