summaryrefslogtreecommitdiff
path: root/js/src/frontend/Parser.h
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-07-13 23:20:19 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-07-18 22:38:43 -0400
commitb23271d447f6f9d01e7ac2bae2c337c704c55e57 (patch)
tree169e4c59f59a972db0fd8d3d54780ec63406fae9 /js/src/frontend/Parser.h
parent1c28c2f9bdd0bde2d83bda1416e33a18c88bba02 (diff)
downloaduxp-b23271d447f6f9d01e7ac2bae2c337c704c55e57.tar.gz
1357506 - Remove assert that constructorBox can only be set once when parsing classes.
Both asm.js and syntax parsing can abort and rewind parsing of an inner function. The bookkeeping to make sure that a class's constructor FunctionBox is only set once is not worth it -- duplicate constructor definitions already throw an early error.
Diffstat (limited to 'js/src/frontend/Parser.h')
-rw-r--r--js/src/frontend/Parser.h21
1 files changed, 3 insertions, 18 deletions
diff --git a/js/src/frontend/Parser.h b/js/src/frontend/Parser.h
index 65e46a65ed..7866bc4fd7 100644
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -85,29 +85,14 @@ class ParseContext : public Nestable<ParseContext>
}
};
- class ClassStatement : public Statement
+ struct ClassStatement : public Statement
{
- FunctionBox* constructorBox_;
+ FunctionBox* constructorBox;
- public:
explicit ClassStatement(ParseContext* pc)
: Statement(pc, StatementKind::Class),
- constructorBox_(nullptr)
+ constructorBox(nullptr)
{ }
-
- void clearConstructorBoxForAbortedSyntaxParse(FunctionBox* funbox) {
- MOZ_ASSERT(constructorBox_ == funbox);
- constructorBox_ = nullptr;
- }
-
- void setConstructorBox(FunctionBox* funbox) {
- MOZ_ASSERT(!constructorBox_);
- constructorBox_ = funbox;
- }
-
- FunctionBox* constructorBox() const {
- return constructorBox_;
- }
};
// The intra-function scope stack.