Bug 57295

Summary: ES5 Strict mode does not allow getter and setter for same propId
Product: WebKit Reporter: Ryan Berdeen <ryan>
Component: JavaScriptCoreAssignee: Oliver Hunt <oliver>
Status: RESOLVED FIXED    
Severity: Normal CC: oliver
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.6   
URL: http://static.ryanberdeen.com/share/2011/03/strict-accessor.html
Attachments:
Description Flags
Patch barraclough: review+

Ryan Berdeen
Reported 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.
Attachments
Patch (4.78 KB, patch)
2011-05-01 21:47 PDT, Oliver Hunt
barraclough: review+
Oliver Hunt
Comment 1 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.
Oliver Hunt
Comment 2 2011-05-01 21:47:56 PDT
Oliver Hunt
Comment 3 2011-05-01 21:52:10 PDT
Note You need to log in before you can comment on or make changes to this bug.