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

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

Issue 2100623002: [parser] report error for shorthand property "await" in async arrow formals (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: also test in preparser Created 4 years, 6 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/cctest/test-parsing.cc » ('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/base/hashmap.h" 10 #include "src/base/hashmap.h"
(...skipping 1928 matching lines...) Expand 10 before | Expand all | Expand 10 after
1939 // CoverInitializedName 1939 // CoverInitializedName
1940 // IdentifierReference Initializer? 1940 // IdentifierReference Initializer?
1941 if (classifier->duplicate_finder() != nullptr && 1941 if (classifier->duplicate_finder() != nullptr &&
1942 scanner()->FindSymbol(classifier->duplicate_finder(), 1) != 0) { 1942 scanner()->FindSymbol(classifier->duplicate_finder(), 1) != 0) {
1943 classifier->RecordDuplicateFormalParameterError(scanner()->location()); 1943 classifier->RecordDuplicateFormalParameterError(scanner()->location());
1944 } 1944 }
1945 if (name_token == Token::LET) { 1945 if (name_token == Token::LET) {
1946 classifier->RecordLetPatternError( 1946 classifier->RecordLetPatternError(
1947 scanner()->location(), MessageTemplate::kLetInLexicalBinding); 1947 scanner()->location(), MessageTemplate::kLetInLexicalBinding);
1948 } 1948 }
1949 if (is_await && is_async_function()) { 1949 if (is_await) {
1950 classifier->RecordPatternError( 1950 if (is_async_function()) {
1951 Scanner::Location(next_beg_pos, next_end_pos), 1951 classifier->RecordPatternError(
1952 MessageTemplate::kAwaitBindingIdentifier); 1952 Scanner::Location(next_beg_pos, next_end_pos),
1953 MessageTemplate::kAwaitBindingIdentifier);
1954 } else {
1955 classifier->RecordAsyncArrowFormalParametersError(
1956 Scanner::Location(next_beg_pos, next_end_pos),
1957 MessageTemplate::kAwaitBindingIdentifier);
1958 }
1953 } 1959 }
1954 ExpressionT lhs = this->ExpressionFromIdentifier( 1960 ExpressionT lhs = this->ExpressionFromIdentifier(
1955 *name, next_beg_pos, next_end_pos, scope_, factory()); 1961 *name, next_beg_pos, next_end_pos, scope_, factory());
1956 CheckDestructuringElement(lhs, classifier, next_beg_pos, next_end_pos); 1962 CheckDestructuringElement(lhs, classifier, next_beg_pos, next_end_pos);
1957 1963
1958 if (peek() == Token::ASSIGN) { 1964 if (peek() == Token::ASSIGN) {
1959 Consume(Token::ASSIGN); 1965 Consume(Token::ASSIGN);
1960 ExpressionClassifier rhs_classifier(this); 1966 ExpressionClassifier rhs_classifier(this);
1961 ExpressionT rhs = this->ParseAssignmentExpression( 1967 ExpressionT rhs = this->ParseAssignmentExpression(
1962 true, &rhs_classifier, CHECK_OK_CUSTOM(EmptyObjectLiteralProperty)); 1968 true, &rhs_classifier, CHECK_OK_CUSTOM(EmptyObjectLiteralProperty));
(...skipping 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after
3630 has_seen_constructor_ = true; 3636 has_seen_constructor_ = true;
3631 return; 3637 return;
3632 } 3638 }
3633 } 3639 }
3634 3640
3635 3641
3636 } // namespace internal 3642 } // namespace internal
3637 } // namespace v8 3643 } // namespace v8
3638 3644
3639 #endif // V8_PARSING_PARSER_BASE_H 3645 #endif // V8_PARSING_PARSER_BASE_H
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698