| 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 3675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3686 bool accept_OF = expression->IsVariableProxy(); | 3686 bool accept_OF = expression->IsVariableProxy(); |
| 3687 is_let_identifier_expression = | 3687 is_let_identifier_expression = |
| 3688 expression->IsVariableProxy() && | 3688 expression->IsVariableProxy() && |
| 3689 expression->AsVariableProxy()->raw_name() == | 3689 expression->AsVariableProxy()->raw_name() == |
| 3690 ast_value_factory()->let_string(); | 3690 ast_value_factory()->let_string(); |
| 3691 | 3691 |
| 3692 if (CheckInOrOf(accept_OF, &mode, ok)) { | 3692 if (CheckInOrOf(accept_OF, &mode, ok)) { |
| 3693 if (!*ok) return nullptr; | 3693 if (!*ok) return nullptr; |
| 3694 expression = this->CheckAndRewriteReferenceExpression( | 3694 expression = this->CheckAndRewriteReferenceExpression( |
| 3695 expression, lhs_beg_pos, lhs_end_pos, | 3695 expression, lhs_beg_pos, lhs_end_pos, |
| 3696 MessageTemplate::kInvalidLhsInFor, CHECK_OK); | 3696 MessageTemplate::kInvalidLhsInFor, kSyntaxError, CHECK_OK); |
| 3697 | 3697 |
| 3698 ForEachStatement* loop = | 3698 ForEachStatement* loop = |
| 3699 factory()->NewForEachStatement(mode, labels, stmt_pos); | 3699 factory()->NewForEachStatement(mode, labels, stmt_pos); |
| 3700 Target target(&this->target_stack_, loop); | 3700 Target target(&this->target_stack_, loop); |
| 3701 | 3701 |
| 3702 Expression* enumerable = ParseExpression(true, CHECK_OK); | 3702 Expression* enumerable = ParseExpression(true, CHECK_OK); |
| 3703 Expect(Token::RPAREN, CHECK_OK); | 3703 Expect(Token::RPAREN, CHECK_OK); |
| 3704 | 3704 |
| 3705 Statement* body = ParseSubStatement(NULL, CHECK_OK); | 3705 Statement* body = ParseSubStatement(NULL, CHECK_OK); |
| 3706 InitializeForEachStatement(loop, expression, enumerable, body); | 3706 InitializeForEachStatement(loop, expression, enumerable, body); |
| (...skipping 2308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6015 Expression* Parser::SpreadCallNew(Expression* function, | 6015 Expression* Parser::SpreadCallNew(Expression* function, |
| 6016 ZoneList<v8::internal::Expression*>* args, | 6016 ZoneList<v8::internal::Expression*>* args, |
| 6017 int pos) { | 6017 int pos) { |
| 6018 args->InsertAt(0, function, zone()); | 6018 args->InsertAt(0, function, zone()); |
| 6019 | 6019 |
| 6020 return factory()->NewCallRuntime( | 6020 return factory()->NewCallRuntime( |
| 6021 ast_value_factory()->reflect_construct_string(), NULL, args, pos); | 6021 ast_value_factory()->reflect_construct_string(), NULL, args, pos); |
| 6022 } | 6022 } |
| 6023 } // namespace internal | 6023 } // namespace internal |
| 6024 } // namespace v8 | 6024 } // namespace v8 |
| OLD | NEW |