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

Unified Diff: src/preparser.h

Issue 584993002: ES6: Implement object literal property shorthand (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: git rebase Created 6 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 | src/token.h » ('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 78f6a269f024a1a10d6a940102f937f748f8e8d1..b34b04e15252ee30774e2f6ebfd339f88fd646a0 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -2027,6 +2027,12 @@ typename ParserBase<Traits>::ObjectLiteralPropertyT ParserBase<
CHECK_OK_CUSTOM(EmptyObjectLiteralProperty));
return factory()->NewObjectLiteralProperty(is_get, value, next_pos,
is_static);
+
+ } else if (!in_class && allow_harmony_object_literals_ &&
+ Token::IsIdentifier(name_token, strict_mode(),
+ this->is_generator())) {
+ value = this->ExpressionFromIdentifier(name, next_pos, scope_, factory());
+
} else {
Token::Value next = Next();
ReportUnexpectedToken(next);
« no previous file with comments | « no previous file | src/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698