]> git.saurik.com Git - cycript.git/commitdiff
Allow ECMA6 property-name-is-also-the-value shortcut.
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 7 Jun 2012 20:52:27 +0000 (13:52 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 7 Jun 2012 20:54:22 +0000 (13:54 -0700)
Cycript.yy.in

index 9b9a05c09157f4d3e1004c3834bc9216a9aa6ade..f4c6a20aa2c188b9f56d141f9a8246e0c7245c1b 100644 (file)
@@ -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
     ;