RESOLVED INVALID 24995
Object literal accessors are restricted to function literal names
https://bugs.webkit.org/show_bug.cgi?id=24995
Summary Object literal accessors are restricted to function literal names
Eli Grey (:sephr)
Reported 2009-04-01 17:02:18 PDT
Object literal accessors ([gs]etters) are restricted to function literal names (ie. "fooBar" is valid, but "foo-bar" is not). There is currently no way at all in WebKit to use other names in object literals. I think WebKit should implement something along the lines of Mozilla's syntax for object literal accessors: {'property-name string' [gs]etter:function () {...}}
Attachments
Mozilla syntax testcase (755 bytes, text/html)
2009-04-01 17:03 PDT, Eli Grey (:sephr)
no flags
Eli Grey (:sephr)
Comment 1 2009-04-01 17:03:32 PDT
Created attachment 29181 [details] Mozilla syntax testcase
Oliver Hunt
Comment 2 2010-07-08 22:04:18 PDT
This is non-standard, and not widely used so there's no compatibility reason to support the syntax. If you really feel the need for this you should suggest it on the ecmascript mailing list
Note You need to log in before you can comment on or make changes to this bug.