Bug 1456761 - Update buildFunction for the multipart grammar. (r=Yoric)
authorEric Faust <efaustbmo@gmail.com>
Mon, 30 Apr 2018 23:55:36 -0700
changeset 416388 6fdf52934a04f7aca7e3a0a1e8a180b7c9e0305b
parent 416387 294524718c9af630cee7efc3b80f27f267ccb0c3
child 416389 b7662a1cd8cbf0ea1bb49231a8c35d6fcb0a24b3
push id102774
push userefaustbmo@gmail.com
push dateTue, 01 May 2018 06:57:37 +0000
treeherdermozilla-inbound@788d13487010 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersYoric
bugs1456761
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1456761 - Update buildFunction for the multipart grammar. (r=Yoric)
js/src/frontend/BinSource.cpp
--- a/js/src/frontend/BinSource.cpp
+++ b/js/src/frontend/BinSource.cpp
@@ -159,17 +159,20 @@ BinASTParser<Tok>::buildFunction(const s
 
     TokenPos pos = tokenizer_->pos(start);
 
     funbox->function()->setArgCount(params ? uint16_t(params->pn_count) : 0);
 
     // ParseNode represents the body as concatenated after the params.
     params->appendWithoutOrderAssumption(body);
 
-    BINJS_TRY_DECL(result, kind == BinKind::FunctionDeclaration
+    bool isStatement = kind == BinKind::EagerFunctionDeclaration ||
+                       kind == BinKind::SkippableFunctionDeclaration;
+
+    BINJS_TRY_DECL(result, isStatement
                      ? factory_.newFunctionStatement(pos)
                      : factory_.newFunctionExpression(pos));
 
     factory_.setFunctionBox(result, funbox);
     factory_.setFunctionFormalParametersAndBody(result, params);
 
     HandlePropertyName dotThis = cx_->names().dotThis;
     const bool declareThis = hasUsedName(dotThis) ||