Bug 57295 - ES5 Strict mode does not allow getter and setter for same propId
Summary: ES5 Strict mode does not allow getter and setter for same propId
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.6
: P2 Normal
Assignee: Oliver Hunt
URL: http://static.ryanberdeen.com/share/2...
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-28 20:08 PDT by Ryan Berdeen
Modified: 2011-05-01 21:52 PDT (History)
1 user (show)

See Also:


Attachments
Patch (4.78 KB, patch)
2011-05-01 21:47 PDT, Oliver Hunt
barraclough: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Berdeen 2011-03-28 20:08:26 PDT
In strict mode, an object literal with a getter and setter for the same property will cause WebKit to raise a syntax error.

This should be valid, but raises a syntax error due to the presence of the setter:

'use strict';
var o = {
    get x () {},
    set x () {}
};

Changing the property name for either getter or setter will eliminate the syntax error.

This behavior does not seem to follow ยง11.1.5.
Comment 1 Oliver Hunt 2011-05-01 20:00:26 PDT
Whoops, I think i left in a piece of code from when i was debugging.  Need to verify but the fix is trivial.

Please CC me on any other strict mode bugs that you find.
Comment 2 Oliver Hunt 2011-05-01 21:47:56 PDT
Created attachment 91879 [details]
Patch
Comment 3 Oliver Hunt 2011-05-01 21:52:10 PDT
Committed r85455: <http://trac.webkit.org/changeset/85455>