<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 - Typed array private name resolvable only after public name has been seen"
   href="https://bugs.webkit.org/show_bug.cgi?id=167697">167697</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Typed array private name resolvable only after public name has been seen
          </td>
        </tr>

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

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

        <tr>
          <th>Version</th>
          <td>WebKit Nightly 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>romain.wkt&#64;gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>While working on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - [Readable Streams API] Implement ReadableByteStreamController pull()"
   href="show_bug.cgi?id=167593">https://bugs.webkit.org/show_bug.cgi?id=167593</a>, I found out that private names of typed arrays (e.g. &#64;Uint8Array) cannot be resolved unless the public name has been met before (e.g. Uint8Array). This issue can be seen when running LayoutTests/streams/readable-byte-stream-controller.html: one of the tests fails with the error &quot;Can't find private variable: &#64;Uint8Array&quot; (&#64;Uint8Array is used in a builtin function in Source/WebCore/Modules/streams/ReadableByteStreamInternals.js). However, if a line such as &quot;const tmp = Uint8Array&quot; is added in test file, the test passes.

Typed arrays are initialized as lazy classes in JSGlobalObject.cpp. The last step of this init consists in declaring considered private name. Hence, private names such as &#64;Uint8Array can be resolved only once the late init has been performed, i.e. once public name has been met.

Would it be possible to perform the same late init process when the private typed array name is met? (i.e. the first time either the private or public name is met, late init is performed) I was not able to determine how to do so, but my understanding of JSCore is quite limited. Alternatively, I was able to fix this bug by &quot;unlazying&quot; typed arrays, but removing an optimization may not be the right approach.</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>