| 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/v8.h" | 5 #include "src/v8.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/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
| 10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
| (...skipping 3865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3876 | 3876 |
| 3877 bool has_rest = false; | 3877 bool has_rest = false; |
| 3878 Expect(Token::LPAREN, CHECK_OK); | 3878 Expect(Token::LPAREN, CHECK_OK); |
| 3879 int start_position = scanner()->location().beg_pos; | 3879 int start_position = scanner()->location().beg_pos; |
| 3880 scope_->set_start_position(start_position); | 3880 scope_->set_start_position(start_position); |
| 3881 num_parameters = ParseFormalParameterList(scope, &has_rest, | 3881 num_parameters = ParseFormalParameterList(scope, &has_rest, |
| 3882 &formals_classifier, CHECK_OK); | 3882 &formals_classifier, CHECK_OK); |
| 3883 Expect(Token::RPAREN, CHECK_OK); | 3883 Expect(Token::RPAREN, CHECK_OK); |
| 3884 int formals_end_position = scanner()->location().end_pos; | 3884 int formals_end_position = scanner()->location().end_pos; |
| 3885 | 3885 |
| 3886 CheckArityRestrictions(num_parameters, arity_restriction, start_position, | 3886 CheckArityRestrictions(num_parameters, arity_restriction, has_rest, |
| 3887 formals_end_position, CHECK_OK); | 3887 start_position, formals_end_position, CHECK_OK); |
| 3888 | 3888 |
| 3889 Expect(Token::LBRACE, CHECK_OK); | 3889 Expect(Token::LBRACE, CHECK_OK); |
| 3890 | 3890 |
| 3891 // If we have a named function expression, we add a local variable | 3891 // If we have a named function expression, we add a local variable |
| 3892 // declaration to the body of the function with the name of the | 3892 // declaration to the body of the function with the name of the |
| 3893 // function and let it refer to the function itself (closure). | 3893 // function and let it refer to the function itself (closure). |
| 3894 // NOTE: We create a proxy and resolve it here so that in the | 3894 // NOTE: We create a proxy and resolve it here so that in the |
| 3895 // future we can change the AST to only refer to VariableProxies | 3895 // future we can change the AST to only refer to VariableProxies |
| 3896 // instead of Variables and Proxis as is the case now. | 3896 // instead of Variables and Proxis as is the case now. |
| 3897 Variable* fvar = NULL; | 3897 Variable* fvar = NULL; |
| (...skipping 1850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5748 | 5748 |
| 5749 Expression* Parser::SpreadCallNew(Expression* function, | 5749 Expression* Parser::SpreadCallNew(Expression* function, |
| 5750 ZoneList<v8::internal::Expression*>* args, | 5750 ZoneList<v8::internal::Expression*>* args, |
| 5751 int pos) { | 5751 int pos) { |
| 5752 args->InsertAt(0, function, zone()); | 5752 args->InsertAt(0, function, zone()); |
| 5753 | 5753 |
| 5754 return factory()->NewCallRuntime( | 5754 return factory()->NewCallRuntime( |
| 5755 ast_value_factory()->reflect_construct_string(), NULL, args, pos); | 5755 ast_value_factory()->reflect_construct_string(), NULL, args, pos); |
| 5756 } | 5756 } |
| 5757 } } // namespace v8::internal | 5757 } } // namespace v8::internal |
| OLD | NEW |