diff options
author | Brian Smith <brian@dbsoft.org> | 2023-05-08 18:28:18 -0500 |
---|---|---|
committer | Brian Smith <brian@dbsoft.org> | 2023-05-08 18:28:18 -0500 |
commit | 13536bf8c99ce19f3e08ea3a1287e78b1811cd42 (patch) | |
tree | 9ef4e2459c23ae0193bd1cd86b37cdb3fafca96e /js/src/jsscript.h | |
parent | 2971cffab479097415e383366561d514086d0d0b (diff) | |
download | uxp-13536bf8c99ce19f3e08ea3a1287e78b1811cd42.tar.gz |
Issue #2236 - Fix import.meta module error in lambdas by moving parseGoal() into SharedContext.
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1604792
Also remove ParseGoal being passed through Parser introduced in #1691 Part 2.
Diffstat (limited to 'js/src/jsscript.h')
-rw-r--r-- | js/src/jsscript.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/js/src/jsscript.h b/js/src/jsscript.h index 5d6c09dba6..78afa2eec2 100644 --- a/js/src/jsscript.h +++ b/js/src/jsscript.h @@ -2108,7 +2108,7 @@ class LazyScript : public gc::TenuredCell uint32_t isFieldInitializer : 1; uint32_t needsHomeObject : 1; uint32_t hasRest : 1; - uint32_t parseGoal : 1; + uint32_t hasModuleGoal : 1; }; union { @@ -2150,8 +2150,7 @@ class LazyScript : public gc::TenuredCell const frontend::AtomVector& closedOverBindings, Handle<GCVector<JSFunction*, 8>> innerFunctions, JSVersion version, uint32_t begin, uint32_t end, - uint32_t toStringStart, uint32_t lineno, uint32_t column, - frontend::ParseGoal parseGoal); + uint32_t toStringStart, uint32_t lineno, uint32_t column); // Create a LazyScript and initialize the closedOverBindings and the // innerFunctions with dummy values to be replaced in a later initialization @@ -2262,8 +2261,20 @@ class LazyScript : public gc::TenuredCell p_.isExprBody = true; } - frontend::ParseGoal parseGoal() const { - return frontend::ParseGoal(p_.parseGoal); + // This was added in Issue #2236 to compensate for the lack of + // Mozilla's ImmutableFlags feature, if ImmutableFlags ever gets + // ported remove the next 2 methods. + bool hasModuleGoal() const { + return p_.hasModuleGoal; + } + + void setHasModuleGoal() { + p_.hasModuleGoal = true; + } + + js::frontend::ParseGoal parseGoal() const { + return hasModuleGoal() ? js::frontend::ParseGoal::Module + : js::frontend::ParseGoal::Script; } bool strict() const { |