<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - ES6: Make Array.prototype.splice implement step 8 of its spec."
   href="https://bugs.webkit.org/show_bug.cgi?id=163417">163417</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ES6: Make Array.prototype.splice implement step 8 of its spec.
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Local Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>JavaScriptCore
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mark.lam&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Step 8 of the Array.prototype.splice spec (<a href="https://tc39.github.io/ecma262/#sec-array.prototype.splice">https://tc39.github.io/ecma262/#sec-array.prototype.splice</a>) states that we should throw a TypeError if the spliced array's length will exceed 2^53-1.  This is gated on the JSArray getLength() convenience function being updated to return a length value that is greater than 32-bits.  This issue is only a compliance issue in a contrived example, e.g.

    var maxLength = (2 ** 53) - 1;
    Array.prototype.splice.call({ length: maxLength }, maxLength, 0, 1, 2, 3);

In real world code, the JSC runtime prevents us from creating arrays with a length that exceeds UINT_MAX.  We're also bounded on the number of args that we pass to Array.prototype.splice.  As a result, we can never splice together an array that gets anywhere near 2^53-1.  We'll get an OutOfMemoryError long before then.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>