RESOLVED FIXED 79571
StringLiteral and NumericLiteral are allowed as ObjectLiteral getter / setter name
https://bugs.webkit.org/show_bug.cgi?id=79571
Summary StringLiteral and NumericLiteral are allowed as ObjectLiteral getter / setter...
Yusuke Suzuki
Reported 2012-02-25 08:47:29 PST
According to ECMA262 5.1 section 11.1.5 'Object Initialiser', getter and setter name is 'PropertyName'. PropertyAssignment : PropertyName : AssignmentExpression get PropertyName ( ) { FunctionBody } set PropertyName ( PropertySetParameterList ) { FunctionBody } And PropertyName contains StringLiteral and NumericLiteral. PropertyName : IdentifierName StringLiteral NumericLiteral So StringLiteral and NumericLiteral are allowed as ObjectLiteral getter / setter name. for example, var obj = { get 42() { return 42; }, get 'string'() { return 'string'; } }; is valid syntax.
Attachments
Patch (7.83 KB, patch)
2012-02-25 08:59 PST, Yusuke Suzuki
no flags
Patch (7.99 KB, patch)
2012-02-25 10:07 PST, Yusuke Suzuki
no flags
Patch (8.98 KB, patch)
2012-02-26 07:30 PST, Yusuke Suzuki
no flags
Yusuke Suzuki
Comment 1 2012-02-25 08:59:12 PST
WebKit Review Bot
Comment 2 2012-02-25 09:55:31 PST
Comment on attachment 128869 [details] Patch Attachment 128869 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11626440 New failing tests: fast/js/property-getters-and-setters.html
Yusuke Suzuki
Comment 3 2012-02-25 10:07:09 PST
Yusuke Suzuki
Comment 4 2012-02-25 10:08:42 PST
Sorry, fixed variable names o9, o10 on LayoutTests property-getters-and-setters.
WebKit Review Bot
Comment 5 2012-02-25 12:45:53 PST
Comment on attachment 128872 [details] Patch Attachment 128872 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11633409 New failing tests: fast/js/property-getters-and-setters.html inspector/protocol/console-agent.html
Gavin Barraclough
Comment 6 2012-02-25 20:24:08 PST
Comment on attachment 128872 [details] Patch Nice fix!
WebKit Review Bot
Comment 7 2012-02-26 01:28:14 PST
Comment on attachment 128872 [details] Patch Rejecting attachment 128872 [details] from commit-queue. New failing tests: fast/js/property-getters-and-setters.html compositing/reflections/nested-reflection-transformed.html Full output: http://queues.webkit.org/results/11628599
Yusuke Suzuki
Comment 8 2012-02-26 07:28:53 PST
Oops! I overlooked that there is LayoutTests/platform/chromium/fast/js/property-getters-and-setters-expected.txt! So I attached revised patch soon, sorry to trouble you.
Yusuke Suzuki
Comment 9 2012-02-26 07:30:13 PST
WebKit Review Bot
Comment 10 2012-02-26 14:49:51 PST
The commit-queue encountered the following flaky tests while processing attachment 128913 [details]: inspector/protocol/console-agent.html bug 79563 (authors: caseq@chromium.org, loislo@chromium.org, and pfeldman@chromium.org) The commit-queue is continuing to process your patch.
WebKit Review Bot
Comment 11 2012-02-26 14:51:52 PST
Comment on attachment 128913 [details] Patch Clearing flags on attachment: 128913 Committed r108935: <http://trac.webkit.org/changeset/108935>
WebKit Review Bot
Comment 12 2012-02-26 14:51:57 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.