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 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 PreParserFormalParameters formals(function_scope); | 977 PreParserFormalParameters formals(function_scope); |
978 ParseFormalParameterList(&formals, &formals_classifier, CHECK_OK); | 978 ParseFormalParameterList(&formals, &formals_classifier, CHECK_OK); |
979 Expect(Token::RPAREN, CHECK_OK); | 979 Expect(Token::RPAREN, CHECK_OK); |
980 int formals_end_position = scanner()->location().end_pos; | 980 int formals_end_position = scanner()->location().end_pos; |
981 | 981 |
982 CheckArityRestrictions(formals.arity, kind, formals.has_rest, start_position, | 982 CheckArityRestrictions(formals.arity, kind, formals.has_rest, start_position, |
983 formals_end_position, CHECK_OK); | 983 formals_end_position, CHECK_OK); |
984 | 984 |
985 // See Parser::ParseFunctionLiteral for more information about lazy parsing | 985 // See Parser::ParseFunctionLiteral for more information about lazy parsing |
986 // and lazy compilation. | 986 // and lazy compilation. |
987 bool is_lazily_parsed = | 987 bool is_lazily_parsed = (outer_is_script_scope && allow_lazy() && |
988 (outer_is_script_scope && allow_lazy() && !parenthesized_function_); | 988 !function_state_->this_function_is_parenthesized()); |
989 parenthesized_function_ = false; | |
990 | 989 |
991 Expect(Token::LBRACE, CHECK_OK); | 990 Expect(Token::LBRACE, CHECK_OK); |
992 if (is_lazily_parsed) { | 991 if (is_lazily_parsed) { |
993 ParseLazyFunctionLiteralBody(CHECK_OK); | 992 ParseLazyFunctionLiteralBody(CHECK_OK); |
994 } else { | 993 } else { |
995 ParseStatementList(Token::RBRACE, CHECK_OK); | 994 ParseStatementList(Token::RBRACE, CHECK_OK); |
996 } | 995 } |
997 Expect(Token::RBRACE, CHECK_OK); | 996 Expect(Token::RBRACE, CHECK_OK); |
998 | 997 |
999 // Parsing the body may change the language mode in our scope. | 998 // Parsing the body may change the language mode in our scope. |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 Expect(Token::RBRACE, CHECK_OK); | 1123 Expect(Token::RBRACE, CHECK_OK); |
1125 return PreParserExpression::Default(); | 1124 return PreParserExpression::Default(); |
1126 } | 1125 } |
1127 } | 1126 } |
1128 | 1127 |
1129 #undef CHECK_OK | 1128 #undef CHECK_OK |
1130 | 1129 |
1131 | 1130 |
1132 } // namespace internal | 1131 } // namespace internal |
1133 } // namespace v8 | 1132 } // namespace v8 |
OLD | NEW |