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

Unified Diff: src/preparser.h

Issue 1328083002: [es6] support `get` and `set` in shorthand properties (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index 4f710fb65a7301543da44fa206300506d9afd255..9f2b13212c6526f7d130502e0d08a315177671fb 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -2655,7 +2655,9 @@ ParserBase<Traits>::ParsePropertyDefinition(
// static MethodDefinition
return ParsePropertyDefinition(checker, true, has_extends, true,
is_computed_name, nullptr, classifier, ok);
- } else if (is_get || is_set) {
+ } else if ((is_get || is_set) &&
+ (in_class || (peek() != Token::RBRACE && peek() != Token::COMMA &&
+ peek() != Token::ASSIGN))) {
// Accessor
name = this->EmptyIdentifier();
bool dont_care = false;
« 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