Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(949)

Side by Side Diff: src/parser.cc

Issue 1310213002: Debugger: use correct position for for-next expression statement. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/es6/debug-stepnext-for.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/parser.h" 5 #include "src/parser.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/ast-literal-reindexer.h" 9 #include "src/ast-literal-reindexer.h"
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 3734 matching lines...) Expand 10 before | Expand all | Expand 10 after
3745 } 3745 }
3746 3746
3747 Expression* cond = NULL; 3747 Expression* cond = NULL;
3748 if (peek() != Token::SEMICOLON) { 3748 if (peek() != Token::SEMICOLON) {
3749 cond = ParseExpression(true, CHECK_OK); 3749 cond = ParseExpression(true, CHECK_OK);
3750 } 3750 }
3751 Expect(Token::SEMICOLON, CHECK_OK); 3751 Expect(Token::SEMICOLON, CHECK_OK);
3752 3752
3753 Statement* next = NULL; 3753 Statement* next = NULL;
3754 if (peek() != Token::RPAREN) { 3754 if (peek() != Token::RPAREN) {
3755 int next_pos = position();
3756 Expression* exp = ParseExpression(true, CHECK_OK); 3755 Expression* exp = ParseExpression(true, CHECK_OK);
3757 next = factory()->NewExpressionStatement(exp, next_pos); 3756 next = factory()->NewExpressionStatement(exp, exp->position());
3758 } 3757 }
3759 Expect(Token::RPAREN, CHECK_OK); 3758 Expect(Token::RPAREN, CHECK_OK);
3760 3759
3761 Statement* body = ParseSubStatement(NULL, CHECK_OK); 3760 Statement* body = ParseSubStatement(NULL, CHECK_OK);
3762 3761
3763 Statement* result = NULL; 3762 Statement* result = NULL;
3764 if (lexical_bindings.length() > 0) { 3763 if (lexical_bindings.length() > 0) {
3765 scope_ = for_scope; 3764 scope_ = for_scope;
3766 result = DesugarLexicalBindingsInForStatement( 3765 result = DesugarLexicalBindingsInForStatement(
3767 inner_scope, is_const, &lexical_bindings, loop, init, cond, 3766 inner_scope, is_const, &lexical_bindings, loop, init, cond,
(...skipping 2304 matching lines...) Expand 10 before | Expand all | Expand 10 after
6072 Expression* Parser::SpreadCallNew(Expression* function, 6071 Expression* Parser::SpreadCallNew(Expression* function,
6073 ZoneList<v8::internal::Expression*>* args, 6072 ZoneList<v8::internal::Expression*>* args,
6074 int pos) { 6073 int pos) {
6075 args->InsertAt(0, function, zone()); 6074 args->InsertAt(0, function, zone());
6076 6075
6077 return factory()->NewCallRuntime( 6076 return factory()->NewCallRuntime(
6078 ast_value_factory()->reflect_construct_string(), NULL, args, pos); 6077 ast_value_factory()->reflect_construct_string(), NULL, args, pos);
6079 } 6078 }
6080 } // namespace internal 6079 } // namespace internal
6081 } // namespace v8 6080 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es6/debug-stepnext-for.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698