summaryrefslogtreecommitdiff
path: root/js/src/jsscript.h
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsscript.h')
-rw-r--r--js/src/jsscript.h21
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 {