summaryrefslogtreecommitdiffstats
path: root/js/src/vm/SelfHosting.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-07-03 13:56:49 +0000
committerMoonchild <moonchild@palemoon.org>2020-07-10 18:29:33 +0000
commit3f25d0c8e4d9296f0d45c85c251eab71f076937b (patch)
tree2d5d342b0ea6f7b7cfcedc6bf3349ca3ff6cf418 /js/src/vm/SelfHosting.cpp
parentab0501702637f3448ec16a188a050e5b9f688787 (diff)
downloadUXP-3f25d0c8e4d9296f0d45c85c251eab71f076937b.tar
UXP-3f25d0c8e4d9296f0d45c85c251eab71f076937b.tar.gz
UXP-3f25d0c8e4d9296f0d45c85c251eab71f076937b.tar.lz
UXP-3f25d0c8e4d9296f0d45c85c251eab71f076937b.tar.xz
UXP-3f25d0c8e4d9296f0d45c85c251eab71f076937b.zip
Issue #618 - Align module instantiation/errors with the updated spec.
Store and re-throw module instantiation and evaluation errors. Ref: BZ 1374239, 1394492
Diffstat (limited to 'js/src/vm/SelfHosting.cpp')
-rw-r--r--js/src/vm/SelfHosting.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp
index 2216bf91e..89750d61a 100644
--- a/js/src/vm/SelfHosting.cpp
+++ b/js/src/vm/SelfHosting.cpp
@@ -2060,24 +2060,12 @@ intrinsic_InstantiateModuleFunctionDeclarations(JSContext* cx, unsigned argc, Va
}
static bool
-intrinsic_SetModuleState(JSContext* cx, unsigned argc, Value* vp)
-{
- CallArgs args = CallArgsFromVp(argc, vp);
- MOZ_ASSERT(args.length() == 2);
- RootedModuleObject module(cx, &args[0].toObject().as<ModuleObject>());
- ModuleState newState = args[1].toInt32();
- module->setState(newState);
- args.rval().setUndefined();
- return true;
-}
-
-static bool
-intrinsic_EvaluateModule(JSContext* cx, unsigned argc, Value* vp)
+intrinsic_ExecuteModule(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
MOZ_ASSERT(args.length() == 1);
RootedModuleObject module(cx, &args[0].toObject().as<ModuleObject>());
- return ModuleObject::evaluate(cx, module, args.rval());
+ return ModuleObject::execute(cx, module, args.rval());
}
static bool
@@ -2630,8 +2618,7 @@ static const JSFunctionSpec intrinsic_functions[] = {
JS_FN("CreateNamespaceBinding", intrinsic_CreateNamespaceBinding, 3, 0),
JS_FN("InstantiateModuleFunctionDeclarations",
intrinsic_InstantiateModuleFunctionDeclarations, 1, 0),
- JS_FN("SetModuleState", intrinsic_SetModuleState, 1, 0),
- JS_FN("EvaluateModule", intrinsic_EvaluateModule, 1, 0),
+ JS_FN("ExecuteModule", intrinsic_ExecuteModule, 1, 0),
JS_FN("NewModuleNamespace", intrinsic_NewModuleNamespace, 2, 0),
JS_FN("AddModuleNamespaceBinding", intrinsic_AddModuleNamespaceBinding, 4, 0),
JS_FN("ModuleNamespaceExports", intrinsic_ModuleNamespaceExports, 1, 0),