Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Side by Side Diff: src/parsing/parser-base.h

Issue 1630823006: Ensure arrow functions can close over lexically-scoped variables (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-580934.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-580934.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698