| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 scope_, IsArrowFunction(kind) ? ARROW_SCOPE : FUNCTION_SCOPE, kind); | 115 scope_, IsArrowFunction(kind) ? ARROW_SCOPE : FUNCTION_SCOPE, kind); |
| 116 if (!has_simple_parameters) function_scope->SetHasNonSimpleParameters(); | 116 if (!has_simple_parameters) function_scope->SetHasNonSimpleParameters(); |
| 117 PreParserFactory function_factory(NULL); | 117 PreParserFactory function_factory(NULL); |
| 118 FunctionState function_state(&function_state_, &scope_, function_scope, kind, | 118 FunctionState function_state(&function_state_, &scope_, function_scope, kind, |
| 119 &function_factory); | 119 &function_factory); |
| 120 DCHECK_EQ(Token::LBRACE, scanner()->current_token()); | 120 DCHECK_EQ(Token::LBRACE, scanner()->current_token()); |
| 121 bool ok = true; | 121 bool ok = true; |
| 122 int start_position = peek_position(); | 122 int start_position = peek_position(); |
| 123 ParseLazyFunctionLiteralBody(&ok, bookmark); | 123 ParseLazyFunctionLiteralBody(&ok, bookmark); |
| 124 if (bookmark && bookmark->HasBeenReset()) { | 124 if (bookmark && bookmark->HasBeenReset()) { |
| 125 ; // Do nothing, as we've just aborted scanning this function. | 125 // Do nothing, as we've just aborted scanning this function. |
| 126 } else if (stack_overflow()) { | 126 } else if (stack_overflow()) { |
| 127 return kPreParseStackOverflow; | 127 return kPreParseStackOverflow; |
| 128 } else if (!ok) { | 128 } else if (!ok) { |
| 129 ReportUnexpectedToken(scanner()->current_token()); | 129 ReportUnexpectedToken(scanner()->current_token()); |
| 130 } else { | 130 } else { |
| 131 DCHECK_EQ(Token::RBRACE, scanner()->peek()); | 131 DCHECK_EQ(Token::RBRACE, scanner()->peek()); |
| 132 if (is_strict(scope_->language_mode())) { | 132 if (is_strict(scope_->language_mode())) { |
| 133 int end_pos = scanner()->location().end_pos; | 133 int end_pos = scanner()->location().end_pos; |
| 134 CheckStrictOctalLiteral(start_position, end_pos, &ok); | 134 CheckStrictOctalLiteral(start_position, end_pos, &ok); |
| 135 if (!ok) return kPreParseSuccess; | 135 if (!ok) return kPreParseSuccess; |
| (...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1231 | 1231 |
| 1232 DCHECK(!spread_pos.IsValid()); | 1232 DCHECK(!spread_pos.IsValid()); |
| 1233 | 1233 |
| 1234 return Expression::Default(); | 1234 return Expression::Default(); |
| 1235 } | 1235 } |
| 1236 | 1236 |
| 1237 #undef CHECK_OK | 1237 #undef CHECK_OK |
| 1238 | 1238 |
| 1239 | 1239 |
| 1240 } } // v8::internal | 1240 } } // v8::internal |
| OLD | NEW |