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/hashmap.h" | 10 #include "src/hashmap.h" |
(...skipping 3009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3020 formal_parameters.materialized_literals_count); | 3020 formal_parameters.materialized_literals_count); |
3021 | 3021 |
3022 this->ReindexLiterals(formal_parameters); | 3022 this->ReindexLiterals(formal_parameters); |
3023 | 3023 |
3024 Expect(Token::ARROW, CHECK_OK); | 3024 Expect(Token::ARROW, CHECK_OK); |
3025 | 3025 |
3026 if (peek() == Token::LBRACE) { | 3026 if (peek() == Token::LBRACE) { |
3027 // Multiple statement body | 3027 // Multiple statement body |
3028 Consume(Token::LBRACE); | 3028 Consume(Token::LBRACE); |
3029 bool is_lazily_parsed = | 3029 bool is_lazily_parsed = |
3030 (mode() == PARSE_LAZILY && scope_->AllowsLazyCompilation()); | 3030 (mode() == PARSE_LAZILY && scope_->AllowsLazyParsing()); |
3031 if (is_lazily_parsed) { | 3031 if (is_lazily_parsed) { |
3032 body = this->NewStatementList(0, zone()); | 3032 body = this->NewStatementList(0, zone()); |
3033 this->SkipLazyFunctionBody(&materialized_literal_count, | 3033 this->SkipLazyFunctionBody(&materialized_literal_count, |
3034 &expected_property_count, CHECK_OK); | 3034 &expected_property_count, CHECK_OK); |
3035 if (formal_parameters.materialized_literals_count > 0) { | 3035 if (formal_parameters.materialized_literals_count > 0) { |
3036 materialized_literal_count += | 3036 materialized_literal_count += |
3037 formal_parameters.materialized_literals_count; | 3037 formal_parameters.materialized_literals_count; |
3038 } | 3038 } |
3039 } else { | 3039 } else { |
3040 body = this->ParseEagerFunctionBody( | 3040 body = this->ParseEagerFunctionBody( |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3338 return; | 3338 return; |
3339 } | 3339 } |
3340 has_seen_constructor_ = true; | 3340 has_seen_constructor_ = true; |
3341 return; | 3341 return; |
3342 } | 3342 } |
3343 } | 3343 } |
3344 } // namespace internal | 3344 } // namespace internal |
3345 } // namespace v8 | 3345 } // namespace v8 |
3346 | 3346 |
3347 #endif // V8_PARSING_PARSER_BASE_H | 3347 #endif // V8_PARSING_PARSER_BASE_H |
OLD | NEW |