Index: src/preparser.h |
diff --git a/src/preparser.h b/src/preparser.h |
index 4f710fb65a7301543da44fa206300506d9afd255..91f4ffc79517ffec2571eaf15442c55c1056007c 100644 |
--- a/src/preparser.h |
+++ b/src/preparser.h |
@@ -2656,10 +2656,16 @@ ParserBase<Traits>::ParsePropertyDefinition( |
return ParsePropertyDefinition(checker, true, has_extends, true, |
is_computed_name, nullptr, classifier, ok); |
} else if (is_get || is_set) { |
+ name_token = peek(); |
+ if (!in_class && |
+ (name_token == Token::ASSIGN || name_token == Token::COMMA || |
+ name_token == Token::RBRACE)) { |
+ goto shorthand_property; |
adamk
2015/09/08 23:17:17
Can't you just do without the goto?
} else if ((i
caitp (gmail)
2015/09/08 23:35:13
That's true. I think this is still a confusing hac
|
+ } |
+ |
// Accessor |
name = this->EmptyIdentifier(); |
bool dont_care = false; |
- name_token = peek(); |
name_expression = ParsePropertyName( |
&name, &dont_care, &dont_care, &dont_care, is_computed_name, classifier, |
@@ -2694,6 +2700,7 @@ ParserBase<Traits>::ParsePropertyDefinition( |
} else if (!in_class && Token::IsIdentifier(name_token, language_mode(), |
this->is_generator())) { |
+ shorthand_property: |
DCHECK(!*is_computed_name); |
DCHECK(!is_static); |