Bug 1499998 - Part 1: Prepend initial yield to the correct node. r=Yoric
authorTooru Fujisawa <arai_a@mac.com>
Mon, 22 Oct 2018 10:31:29 +0900
changeset 490616 c8e1907a781fee3a5311fce566eabe63aa4fe769
parent 490615 ea09443dac2888f8c9f72964f907ccdb66e9960d
child 490617 716178d41d26ed49d2f7f86ab12bc0f5c088af7c
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersYoric
bugs1499998
milestone64.0a1
Bug 1499998 - Part 1: Prepend initial yield to the correct node. r=Yoric
js/src/frontend/BinSource.cpp
--- a/js/src/frontend/BinSource.cpp
+++ b/js/src/frontend/BinSource.cpp
@@ -374,17 +374,18 @@ BinASTParser<Tok>::buildFunction(const s
         }
 
         BINJS_TRY(usedNames_.noteUse(cx_, dotGenerator, parseContext_->scriptId(),
                                      parseContext_->innermostScope()->id()));
 
         BINJS_TRY_DECL(dotGen, factory_.newName(dotGenerator,
                                                 tokenizer_->pos(tokenizer_->offset()), cx_));
 
-        BINJS_TRY(factory_.prependInitialYield(&body->as<ListNode>(), dotGen));
+        ListNode* stmtList = &body->as<LexicalScopeNode>().scopeBody()->as<ListNode>();
+        BINJS_TRY(factory_.prependInitialYield(stmtList, dotGen));
     }
 
     // Check all our bindings after maybe adding function metavars.
     MOZ_TRY(checkFunctionClosedVars());
 
     BINJS_TRY_DECL(bindings,
              NewFunctionScopeData(cx_, parseContext_->functionScope(),
                                   /* hasParameterExprs = */ false, alloc_, parseContext_));