summaryrefslogtreecommitdiffstats
path: root/js/src/frontend/Parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/frontend/Parser.cpp')
-rw-r--r--js/src/frontend/Parser.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
index ec4a975e6..01ab3f64c 100644
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -547,7 +547,7 @@ FunctionBox::initWithEnclosingParseContext(ParseContext* enclosing, FunctionSynt
if (kind == ClassConstructor || kind == DerivedClassConstructor) {
auto stmt = enclosing->findInnermostStatement<ParseContext::ClassStatement>();
MOZ_ASSERT(stmt);
- stmt->setConstructorBox(this);
+ stmt->constructorBox = this;
if (kind == DerivedClassConstructor) {
setDerivedClassConstructor();
@@ -574,16 +574,6 @@ FunctionBox::initWithEnclosingParseContext(ParseContext* enclosing, FunctionSynt
}
void
-FunctionBox::resetForAbortedSyntaxParse(ParseContext* enclosing, FunctionSyntaxKind kind)
-{
- if (kind == ClassConstructor || kind == DerivedClassConstructor) {
- auto stmt = enclosing->findInnermostStatement<ParseContext::ClassStatement>();
- MOZ_ASSERT(stmt);
- stmt->clearConstructorBoxForAbortedSyntaxParse(this);
- }
-}
-
-void
FunctionBox::initWithEnclosingScope(Scope* enclosingScope)
{
if (!function()->isArrow()) {
@@ -3407,7 +3397,6 @@ Parser<FullParseHandler>::trySyntaxParseInnerFunction(ParseNode* pn, HandleFunct
// correctness.
parser->clearAbortedSyntaxParse();
usedNames.rewind(token);
- funbox->resetForAbortedSyntaxParse(pc, kind);
MOZ_ASSERT_IF(parser->context->isJSContext(),
!parser->context->asJSContext()->isExceptionPending());
break;
@@ -7078,7 +7067,7 @@ Parser<ParseHandler>::classDefinition(YieldHandling yieldHandling,
errorAt(nameOffset, JSMSG_BAD_METHOD_DEF);
return null();
}
- if (classStmt.constructorBox()) {
+ if (classStmt.constructorBox) {
errorAt(nameOffset, JSMSG_DUPLICATE_PROPERTY, "constructor");
return null();
}
@@ -7125,7 +7114,7 @@ Parser<ParseHandler>::classDefinition(YieldHandling yieldHandling,
// Amend the toStringEnd offset for the constructor now that we've
// finished parsing the class.
uint32_t classEndOffset = pos().end;
- if (FunctionBox* ctorbox = classStmt.constructorBox()) {
+ if (FunctionBox* ctorbox = classStmt.constructorBox) {
if (ctorbox->function()->isInterpretedLazy())
ctorbox->function()->lazyScript()->setToStringEnd(classEndOffset);
ctorbox->toStringEnd = classEndOffset;