summaryrefslogtreecommitdiffstats
path: root/js/src/vm
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
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')
-rw-r--r--js/src/vm/CommonPropertyNames.h4
-rw-r--r--js/src/vm/SelfHosting.cpp19
2 files changed, 5 insertions, 18 deletions
diff --git a/js/src/vm/CommonPropertyNames.h b/js/src/vm/CommonPropertyNames.h
index b4a2de6f3..aa555886e 100644
--- a/js/src/vm/CommonPropertyNames.h
+++ b/js/src/vm/CommonPropertyNames.h
@@ -227,8 +227,8 @@
macro(missingArguments, missingArguments, "missingArguments") \
macro(module, module, "module") \
macro(Module, Module, "Module") \
- macro(ModuleDeclarationInstantiation, ModuleDeclarationInstantiation, "ModuleDeclarationInstantiation") \
- macro(ModuleEvaluation, ModuleEvaluation, "ModuleEvaluation") \
+ macro(ModuleInstantiate, ModuleInstantiate, "ModuleInstantiate") \
+ macro(ModuleEvaluate, ModuleEvaluate, "ModuleEvaluate") \
macro(month, month, "month") \
macro(multiline, multiline, "multiline") \
macro(name, name, "name") \
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),