From 797cb0e583f817860d6e8672b48af28b1ccfe5b5 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 7 Jun 2012 13:52:27 -0700 Subject: [PATCH] Allow ECMA6 property-name-is-also-the-value shortcut. --- Cycript.yy.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Cycript.yy.in b/Cycript.yy.in index 9b9a05c..f4c6a20 100644 --- a/Cycript.yy.in +++ b/Cycript.yy.in @@ -756,8 +756,9 @@ PropertyDefinitionListOpt ; PropertyDefinition - //: IdentifierName { $$ = CYNew CYProperty($1, CYNew CYVariable($1)); } - : PropertyName ":" AssignmentExpression { $$ = CYNew CYProperty($1, $3); } + // XXX: this should be IdentifierName + : LexSetRegExp Identifier { $$ = CYNew CYProperty($2, CYNew CYVariable($2)); } + | PropertyName ":" AssignmentExpression { $$ = CYNew CYProperty($1, $3); } //| MethodDefinition ; -- 2.47.2