OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |