diff options
author | Moonchild <moonchild@palemoon.org> | 2020-07-08 12:58:30 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-07-08 12:58:30 +0000 |
commit | 43e0632cd474265ef0660bf881f4472996c8ad5a (patch) | |
tree | 70b3b307f37c54a66419995c74a3ac2d06ccb19a /js/src/builtin/TestingFunctions.cpp | |
parent | 786e344698c5a577ea82e2fa0d29faf2a2d851ea (diff) | |
download | uxp-43e0632cd474265ef0660bf881f4472996c8ad5a.tar.gz |
Issue #618 - Align error handling for module scripts with the spec (again)
This updates module implementation to match spec regarding handling of
instantiation errors, after it was changed yet again, this time to not remember
instantiation errors, but instead immediately rethrow applicable ones.
Ref: BZ 1420420
Diffstat (limited to 'js/src/builtin/TestingFunctions.cpp')
-rw-r--r-- | js/src/builtin/TestingFunctions.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index 0256207669..e93ebeec3d 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -3585,6 +3585,9 @@ GetModuleEnvironmentNames(JSContext* cx, unsigned argc, Value* vp) return false; } +//- if (module->status() == MODULE_STATUS_ERRORED) { +//+ if (module->hadEvaluationError()) { + RootedModuleEnvironmentObject env(cx, GetModuleEnvironment(cx, args[0])); Rooted<IdVector> ids(cx, IdVector(cx)); if (!JS_Enumerate(cx, env, &ids)) @@ -3622,6 +3625,9 @@ GetModuleEnvironmentValue(JSContext* cx, unsigned argc, Value* vp) return false; } +//- if (module->status() == MODULE_STATUS_ERRORED) { +//+ if (module->hadEvaluationError()) { + RootedModuleEnvironmentObject env(cx, GetModuleEnvironment(cx, args[0])); RootedString name(cx, args[1].toString()); RootedId id(cx); |