Commit aac6997b authored by Adam Klein's avatar Adam Klein Committed by Commit Bot

[parser] Remove recording of SourceRange from desugared outer for-loop

This loop doesn't itself have a source position, so I wouldn't think
block coverage of it would make any sense (and all tests continue
to pass).

Removing this argument will make some refactoring I'm working on easier.

Bug: v8:6724
Change-Id: I4d6b734e077d9e61ad9362d07e57f155ec556221
Reviewed-on: https://chromium-review.googlesource.com/615385Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47375}
parent f2d46a11
......@@ -5775,8 +5775,7 @@ typename ParserBase<Impl>::StatementT ParserBase<Impl>::ParseStandardForLoop(
if (function_state_->contains_function_or_eval()) {
scope()->set_is_hidden();
return impl()->DesugarLexicalBindingsInForStatement(
loop, init, cond, next, body, body_range, inner_scope, *for_info,
CHECK_OK);
loop, init, cond, next, body, inner_scope, *for_info, CHECK_OK);
} else {
inner_scope = inner_scope->FinalizeBlockScope();
CHECK_NULL(inner_scope);
......
......@@ -2189,8 +2189,7 @@ Statement* Parser::InitializeForOfStatement(
Statement* Parser::DesugarLexicalBindingsInForStatement(
ForStatement* loop, Statement* init, Expression* cond, Statement* next,
Statement* body, const SourceRange& body_range, Scope* inner_scope,
const ForInfo& for_info, bool* ok) {
Statement* body, Scope* inner_scope, const ForInfo& for_info, bool* ok) {
// ES6 13.7.4.8 specifies that on each loop iteration the let variables are
// copied into a new environment. Moreover, the "next" statement must be
// evaluated not in the environment of the just completed iteration but in
......@@ -2421,7 +2420,6 @@ Statement* Parser::DesugarLexicalBindingsInForStatement(
}
outer_loop->Initialize(NULL, NULL, NULL, inner_block);
RecordIterationStatementSourceRange(outer_loop, body_range);
return outer_block;
}
......
......@@ -411,8 +411,7 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
Statement* DesugarLexicalBindingsInForStatement(
ForStatement* loop, Statement* init, Expression* cond, Statement* next,
Statement* body, const SourceRange& body_range, Scope* inner_scope,
const ForInfo& for_info, bool* ok);
Statement* body, Scope* inner_scope, const ForInfo& for_info, bool* ok);
Expression* RewriteDoExpression(Block* body, int pos, bool* ok);
......
......@@ -1399,8 +1399,8 @@ class PreParser : public ParserBase<PreParser> {
V8_INLINE StatementT DesugarLexicalBindingsInForStatement(
PreParserStatement loop, PreParserStatement init,
PreParserExpression cond, PreParserStatement next,
PreParserStatement body, const SourceRange& body_range,
Scope* inner_scope, const ForInfo& for_info, bool* ok) {
PreParserStatement body, Scope* inner_scope, const ForInfo& for_info,
bool* ok) {
// See Parser::DesugarLexicalBindingsInForStatement.
if (track_unresolved_variables_) {
for (auto name : for_info.bound_names) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment