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/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 3908 matching lines...) Loading... |
3919 formal_parameters.scope | 3919 formal_parameters.scope |
3920 ->AllowsLazyParsingWithoutUnresolvedVariables()); | 3920 ->AllowsLazyParsingWithoutUnresolvedVariables()); |
3921 // TODO(marja): consider lazy-parsing inner arrow functions too. is_this | 3921 // TODO(marja): consider lazy-parsing inner arrow functions too. is_this |
3922 // handling in Scope::ResolveVariable needs to change. | 3922 // handling in Scope::ResolveVariable needs to change. |
3923 if (is_lazily_parsed) { | 3923 if (is_lazily_parsed) { |
3924 Scanner::BookmarkScope bookmark(scanner()); | 3924 Scanner::BookmarkScope bookmark(scanner()); |
3925 bookmark.Set(); | 3925 bookmark.Set(); |
3926 LazyParsingResult result = impl()->SkipLazyFunctionBody( | 3926 LazyParsingResult result = impl()->SkipLazyFunctionBody( |
3927 &materialized_literal_count, &expected_property_count, false, true, | 3927 &materialized_literal_count, &expected_property_count, false, true, |
3928 CHECK_OK); | 3928 CHECK_OK); |
| 3929 formal_parameters.scope->ResetAfterPreparsing(); |
3929 | 3930 |
3930 if (formal_parameters.materialized_literals_count > 0) { | 3931 if (formal_parameters.materialized_literals_count > 0) { |
3931 materialized_literal_count += | 3932 materialized_literal_count += |
3932 formal_parameters.materialized_literals_count; | 3933 formal_parameters.materialized_literals_count; |
3933 } | 3934 } |
3934 | 3935 |
3935 if (result == kLazyParsingAborted) { | 3936 if (result == kLazyParsingAborted) { |
3936 bookmark.Apply(); | 3937 bookmark.Apply(); |
3937 // Trigger eager (re-)parsing, just below this block. | 3938 // Trigger eager (re-)parsing, just below this block. |
3938 is_lazily_parsed = false; | 3939 is_lazily_parsed = false; |
(...skipping 1381 matching lines...) Loading... |
5320 has_seen_constructor_ = true; | 5321 has_seen_constructor_ = true; |
5321 return; | 5322 return; |
5322 } | 5323 } |
5323 } | 5324 } |
5324 | 5325 |
5325 | 5326 |
5326 } // namespace internal | 5327 } // namespace internal |
5327 } // namespace v8 | 5328 } // namespace v8 |
5328 | 5329 |
5329 #endif // V8_PARSING_PARSER_BASE_H | 5330 #endif // V8_PARSING_PARSER_BASE_H |
OLD | NEW |