OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 <cmath> | 5 #include <cmath> |
6 | 6 |
7 #include "src/allocation.h" | 7 #include "src/allocation.h" |
8 #include "src/base/logging.h" | 8 #include "src/base/logging.h" |
9 #include "src/conversions-inl.h" | 9 #include "src/conversions-inl.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 PreParserFactory factory(NULL); | 1046 PreParserFactory factory(NULL); |
1047 FunctionState function_state(&function_state_, &scope_, function_scope, kind, | 1047 FunctionState function_state(&function_state_, &scope_, function_scope, kind, |
1048 &factory); | 1048 &factory); |
1049 DuplicateFinder duplicate_finder(scanner()->unicode_cache()); | 1049 DuplicateFinder duplicate_finder(scanner()->unicode_cache()); |
1050 ExpressionClassifier formals_classifier(&duplicate_finder); | 1050 ExpressionClassifier formals_classifier(&duplicate_finder); |
1051 | 1051 |
1052 Expect(Token::LPAREN, CHECK_OK); | 1052 Expect(Token::LPAREN, CHECK_OK); |
1053 int start_position = scanner()->location().beg_pos; | 1053 int start_position = scanner()->location().beg_pos; |
1054 function_scope->set_start_position(start_position); | 1054 function_scope->set_start_position(start_position); |
1055 PreParserFormalParameters formals(nullptr); | 1055 PreParserFormalParameters formals(nullptr); |
1056 int arity = ParseFormalParameterList(&formals, &formals_classifier, CHECK_OK); | 1056 ParseFormalParameterList(&formals, &formals_classifier, CHECK_OK); |
1057 Expect(Token::RPAREN, CHECK_OK); | 1057 Expect(Token::RPAREN, CHECK_OK); |
1058 int formals_end_position = scanner()->location().end_pos; | 1058 int formals_end_position = scanner()->location().end_pos; |
1059 | 1059 |
1060 CheckArityRestrictions(arity, arity_restriction, | 1060 CheckArityRestrictions(formals.arity, arity_restriction, |
1061 formals.has_rest, start_position, | 1061 formals.has_rest, start_position, |
1062 formals_end_position, CHECK_OK); | 1062 formals_end_position, CHECK_OK); |
1063 | 1063 |
1064 // See Parser::ParseFunctionLiteral for more information about lazy parsing | 1064 // See Parser::ParseFunctionLiteral for more information about lazy parsing |
1065 // and lazy compilation. | 1065 // and lazy compilation. |
1066 bool is_lazily_parsed = | 1066 bool is_lazily_parsed = |
1067 (outer_is_script_scope && allow_lazy() && !parenthesized_function_); | 1067 (outer_is_script_scope && allow_lazy() && !parenthesized_function_); |
1068 parenthesized_function_ = false; | 1068 parenthesized_function_ = false; |
1069 | 1069 |
1070 Expect(Token::LBRACE, CHECK_OK); | 1070 Expect(Token::LBRACE, CHECK_OK); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 | 1199 |
1200 DCHECK(!spread_pos.IsValid()); | 1200 DCHECK(!spread_pos.IsValid()); |
1201 | 1201 |
1202 return Expression::Default(); | 1202 return Expression::Default(); |
1203 } | 1203 } |
1204 | 1204 |
1205 #undef CHECK_OK | 1205 #undef CHECK_OK |
1206 | 1206 |
1207 | 1207 |
1208 } } // v8::internal | 1208 } } // v8::internal |
OLD | NEW |