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 500787 c8e1907a781fee3a5311fce566eabe63aa4fe769
parent 500786 ea09443dac2888f8c9f72964f907ccdb66e9960d
child 500788 716178d41d26ed49d2f7f86ab12bc0f5c088af7c
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersYoric
bugs1499998
milestone64.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 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_));