[Webkit-unassigned] [Bug 199365] New: Frozen Arrays length assignment should throw in strict mode

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 1 07:55:48 PDT 2019


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

            Bug ID: 199365
           Summary: Frozen Arrays length assignment should throw in strict
                    mode
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: jason at developit.ca
                CC: keith_miller at apple.com, msaboff at apple.com

In strict mode, assigning to `.length` on a Frozen Array silently fails, when it should raise a TypeError.
I noticed this when I realized I could assign strings.length from within the tag function of a Tagged Template.

Example:

    const a = Object.freeze(['a']);

    // this should throw, but it doesn't:
    a.length = 2;
    console.log(a.length);  // 1

    // this throws correctly:
    // a.x = 2;


Reproduction:
https://jsbin.com/fecosoh/edit?html,console

-- 
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/20190701/b2b9d817/attachment.html>


More information about the webkit-unassigned mailing list