[Webkit-unassigned] [Bug 138857] New: Updating a non-writable property of a coerced primitive object does not throw a TypeError exception in a strict mode

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 18 18:50:23 PST 2014


https://bugs.webkit.org/show_bug.cgi?id=138857

            Bug ID: 138857
           Summary: Updating a non-writable property of a coerced
                    primitive object does not throw a TypeError exception
                    in a strict mode
    Classification: Unclassified
           Product: WebKit
           Version: 528+ (Nightly build)
          Hardware: Macintosh Intel
                OS: Mac OS X 10.9
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: daejunpark at gmail.com

In a strict mode, it should throw a TypeError exception, when attempting to update a non-writable property of a coerced primitive object, but Safari does not.

According to ES5, Section 8.7.2 PutValue (V, W), [[Put]] internal method, Step 2.a,
http://es5.github.io/#x8.7.2

the following code is supposed to throw a TypeError exception, since "x" is not writable in the coerced number object for "1":

"use strict";
Object.defineProperty(Number.prototype, "x", { "value" : 0, "writable" : false, "enumerable" : true, "configurable" : true });
1["x"] = 10; // 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

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20141119/801fe246/attachment-0002.html>


More information about the webkit-unassigned mailing list