WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
138858
Updating an immutable binding does not throw a TypeError exception in a strict mode
https://bugs.webkit.org/show_bug.cgi?id=138858
Summary
Updating an immutable binding does not throw a TypeError exception in a stric...
Daejun Park
Reported
2014-11-18 19:05:53 PST
In a strict mode, it should throw a TypeError exception, when attempting to update an immutable binding, but Safari does not. According to ES5, Section 10.2.1.1.3 SetMutableBinding (N,V,S), Step 4,
http://es5.github.io/#x10.2.1.1.3
the following code is supposed to throw a TypeError exception, since "g" is an immutable binding inside the function body (according to ES5, Section 13 Function Definition, Step 3 of the third block). "use strict"; var f = function g() { g = 0; }; f(); // TypeError However, Safari does not report any exception, while Firefox correctly throws a TypeError exception. I've tested this using the Web Inspector console of Safari 7.0.4. Thanks, Daejun
Attachments
Add attachment
proposed patch, testcase, etc.
Daejun Park
Comment 1
2014-11-19 10:41:10 PST
For your information, this issue appears even if I wrapped the code as follows: function x() { "use strict"; var f = function g() { g = 0; }; f(); // TypeError } x(); Also, I reported this issue for v8:
https://code.google.com/p/v8/issues/detail?id=3704
but it turns out that it was duplicate:
https://code.google.com/p/v8/issues/detail?id=2243
and it will not be fixed because ES6 will consider this as a syntax error. Do you have the same decision for this?
Radar WebKit Bug Importer
Comment 2
2014-11-19 11:16:18 PST
<
rdar://problem/19032831
>
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