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 3874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3885 | 3885 |
3886 bool has_rest = false; | 3886 bool has_rest = false; |
3887 Expect(Token::LPAREN, CHECK_OK); | 3887 Expect(Token::LPAREN, CHECK_OK); |
3888 int start_position = scanner()->location().beg_pos; | 3888 int start_position = scanner()->location().beg_pos; |
3889 scope_->set_start_position(start_position); | 3889 scope_->set_start_position(start_position); |
3890 num_parameters = ParseFormalParameterList(scope, &has_rest, | 3890 num_parameters = ParseFormalParameterList(scope, &has_rest, |
3891 &formals_classifier, CHECK_OK); | 3891 &formals_classifier, CHECK_OK); |
3892 Expect(Token::RPAREN, CHECK_OK); | 3892 Expect(Token::RPAREN, CHECK_OK); |
3893 int formals_end_position = scanner()->location().end_pos; | 3893 int formals_end_position = scanner()->location().end_pos; |
3894 | 3894 |
3895 CheckArityRestrictions(num_parameters, arity_restriction, start_position, | 3895 CheckArityRestrictions(num_parameters, arity_restriction, has_rest, |
3896 formals_end_position, CHECK_OK); | 3896 start_position, formals_end_position, CHECK_OK); |
3897 | 3897 |
3898 Expect(Token::LBRACE, CHECK_OK); | 3898 Expect(Token::LBRACE, CHECK_OK); |
3899 | 3899 |
3900 // If we have a named function expression, we add a local variable | 3900 // If we have a named function expression, we add a local variable |
3901 // declaration to the body of the function with the name of the | 3901 // declaration to the body of the function with the name of the |
3902 // function and let it refer to the function itself (closure). | 3902 // function and let it refer to the function itself (closure). |
3903 // NOTE: We create a proxy and resolve it here so that in the | 3903 // NOTE: We create a proxy and resolve it here so that in the |
3904 // future we can change the AST to only refer to VariableProxies | 3904 // future we can change the AST to only refer to VariableProxies |
3905 // instead of Variables and Proxis as is the case now. | 3905 // instead of Variables and Proxis as is the case now. |
3906 Variable* fvar = NULL; | 3906 Variable* fvar = NULL; |
(...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5760 | 5760 |
5761 Expression* Parser::SpreadCallNew(Expression* function, | 5761 Expression* Parser::SpreadCallNew(Expression* function, |
5762 ZoneList<v8::internal::Expression*>* args, | 5762 ZoneList<v8::internal::Expression*>* args, |
5763 int pos) { | 5763 int pos) { |
5764 args->InsertAt(0, function, zone()); | 5764 args->InsertAt(0, function, zone()); |
5765 | 5765 |
5766 return factory()->NewCallRuntime( | 5766 return factory()->NewCallRuntime( |
5767 ast_value_factory()->reflect_construct_string(), NULL, args, pos); | 5767 ast_value_factory()->reflect_construct_string(), NULL, args, pos); |
5768 } | 5768 } |
5769 } } // namespace v8::internal | 5769 } } // namespace v8::internal |
OLD | NEW |