From: Jay Freeman (saurik) Date: Thu, 7 Jun 2012 20:52:27 +0000 (-0700) Subject: Allow ECMA6 property-name-is-also-the-value shortcut. X-Git-Tag: v0.9.456~4 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/797cb0e583f817860d6e8672b48af28b1ccfe5b5?ds=inline Allow ECMA6 property-name-is-also-the-value shortcut. --- 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 ;