[Webkit-unassigned] [Bug 136445] New: Assignment to a property on a primitive in strict mode should not throw
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Sep 1 23:33:08 PDT 2014
https://bugs.webkit.org/show_bug.cgi?id=136445
Summary: Assignment to a property on a primitive in strict mode
should not throw
Product: WebKit
Version: 528+ (Nightly build)
Platform: Unspecified
OS/Version: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: JavaScriptCore
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: ljharb at gmail.com
`(function () { "use strict"; 3.0.a = true; }())`
`(function () { "use strict"; 'foo'.a = true; }())`
`(function () { "use strict"; true.a = true; }())`
None of these throw exceptions in Chrome, Firefox, Opera - but in Safari 7.1, these all throw a TypeError "Attempted to assign to readonly property.".
According to the ES5 spec ( https://es5.github.io/#C ) and ES6 spec ( https://people.mozilla.org/~jorendorff/es6-draft.html#sec-strict-mode-of-ecmascript ), Safari is in error here. In addition, one of the TC39 spec maintainers confirmed via Twitter that this is a Safari bug ( https://twitter.com/awbjs/status/506687103506587648 )
Steps to Reproduce:
Run any of the JS functions in the console, or any other JS mechanism:
(function () { "use strict"; 3.0.a = true; }())
(function () { "use strict"; 'foo'.a = true; }())
(function () { "use strict"; true.a = true; }())
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list