| 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 #ifndef V8_PARSING_PARSER_BASE_H | 5 #ifndef V8_PARSING_PARSER_BASE_H |
| 6 #define V8_PARSING_PARSER_BASE_H | 6 #define V8_PARSING_PARSER_BASE_H |
| 7 | 7 |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
| 10 #include "src/base/hashmap.h" | 10 #include "src/base/hashmap.h" |
| (...skipping 3442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3453 function_state.SkipMaterializedLiterals( | 3453 function_state.SkipMaterializedLiterals( |
| 3454 formal_parameters.materialized_literals_count); | 3454 formal_parameters.materialized_literals_count); |
| 3455 | 3455 |
| 3456 this->ReindexLiterals(formal_parameters); | 3456 this->ReindexLiterals(formal_parameters); |
| 3457 | 3457 |
| 3458 Expect(Token::ARROW, CHECK_OK); | 3458 Expect(Token::ARROW, CHECK_OK); |
| 3459 | 3459 |
| 3460 if (peek() == Token::LBRACE) { | 3460 if (peek() == Token::LBRACE) { |
| 3461 // Multiple statement body | 3461 // Multiple statement body |
| 3462 Consume(Token::LBRACE); | 3462 Consume(Token::LBRACE); |
| 3463 bool is_lazily_parsed = | 3463 DCHECK_EQ(scope(), formal_parameters.scope); |
| 3464 (mode() == PARSE_LAZILY && scope()->AllowsLazyParsing()); | 3464 bool is_lazily_parsed = (mode() == PARSE_LAZILY && |
| 3465 formal_parameters.scope->AllowsLazyParsing()); |
| 3465 if (is_lazily_parsed) { | 3466 if (is_lazily_parsed) { |
| 3466 body = this->NewStatementList(0, zone()); | 3467 body = this->NewStatementList(0, zone()); |
| 3467 this->SkipLazyFunctionBody(&materialized_literal_count, | 3468 this->SkipLazyFunctionBody(&materialized_literal_count, |
| 3468 &expected_property_count, CHECK_OK); | 3469 &expected_property_count, CHECK_OK); |
| 3469 if (formal_parameters.materialized_literals_count > 0) { | 3470 if (formal_parameters.materialized_literals_count > 0) { |
| 3470 materialized_literal_count += | 3471 materialized_literal_count += |
| 3471 formal_parameters.materialized_literals_count; | 3472 formal_parameters.materialized_literals_count; |
| 3472 } | 3473 } |
| 3473 } else { | 3474 } else { |
| 3474 body = this->ParseEagerFunctionBody( | 3475 body = this->ParseEagerFunctionBody( |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3754 has_seen_constructor_ = true; | 3755 has_seen_constructor_ = true; |
| 3755 return; | 3756 return; |
| 3756 } | 3757 } |
| 3757 } | 3758 } |
| 3758 | 3759 |
| 3759 | 3760 |
| 3760 } // namespace internal | 3761 } // namespace internal |
| 3761 } // namespace v8 | 3762 } // namespace v8 |
| 3762 | 3763 |
| 3763 #endif // V8_PARSING_PARSER_BASE_H | 3764 #endif // V8_PARSING_PARSER_BASE_H |
| OLD | NEW |