WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
93873
Object.prototype.__define{G,S}etter__ with non-callable second parameter should throw TypeError instead of SyntaxError
https://bugs.webkit.org/show_bug.cgi?id=93873
Summary
Object.prototype.__define{G,S}etter__ with non-callable second parameter shou...
Mathias Bynens
Reported
2012-08-13 11:29:46 PDT
For compatibility with other ECMAScript engines, `Object.prototype.__defineGetter__` must behave as described here:
http://mathias.html5.org/specs/javascript/#object.prototype.__definegetter__
JavaScriptCore has a minor bug where it throws a SyntaxError instead of a TypeError in cases like the following: var object = {}; object.__defineGetter__('foo', '_'); Online tests:
http://mathias.html5.org/tests/javascript/object/
Attachments
Fix
(3.89 KB, patch)
2012-09-07 15:41 PDT
,
Gavin Barraclough
sam
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Mathias Bynens
Comment 1
2012-08-13 11:39:54 PDT
So obvious I forgot to mention it, but the same goes for `Object.prototype.__defineSetter__`.
Gavin Barraclough
Comment 2
2012-08-13 12:21:37 PDT
Yup - syntax errors should all be early errors, doesn't sounds appropriate here. We should make this a type error. Thanks for the bug report!
Gavin Barraclough
Comment 3
2012-09-07 15:41:51 PDT
Created
attachment 162885
[details]
Fix
Gavin Barraclough
Comment 4
2012-09-07 15:50:56 PDT
Fixed in
r127930
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug