<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Typed Arrays have no public facing API"
   href="https://bugs.webkit.org/show_bug.cgi?id=120112#c14">Comment # 14</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Typed Arrays have no public facing API"
   href="https://bugs.webkit.org/show_bug.cgi?id=120112">bug 120112</a>
              from <span class="vcard"><a class="email" href="mailto:ggaren&#64;apple.com" title="Geoffrey Garen &lt;ggaren&#64;apple.com&gt;"> <span class="fn">Geoffrey Garen</span></a>
</span></b>
        <pre><span class="quote">&gt; JS_EXPORT JSTypedArrayType JSTypedArrayGetType(JSContextRef ctx, JSValueRef value);
&gt; JS_EXPORT JSObjectRef JSTypedArrayMake(JSContextRef ctx, JSTypedArrayType arrayType, size_t numElements);
&gt; JS_EXPORT void * JSTypedArrayGetDataPtr(JSContextRef ctx, JSValueRef value, size_t * byteLength);</span >

The right phrasing here would be:

JSValueGetTypedArrayType(JSContextRef ctx, JSValueRef value);
OR
JSObjectGetTypedArrayType(JSContextRef ctx, JSObjectRef value);

JSObjectMakeTypedArray(JSContextRef ctx, JSTypedArrayType arrayType, size_t numElements);

JSValueGetTypedArrayDataPtr(JSContextRef ctx, JSValueRef value, size_t * byteLength);
OR
JSObjectGetTypedArrayDataPtr(JSContextRef ctx, JSObjectRef value, size_t * byteLength);

Why does getting the data pointer require a byte length? Why do we use byte length for access but element count for creation?

It seems like the uncontroversial idea in this API is an unforgeable way to create typed arrays using the C and ObjC APIs without having to save the JS constructor objects at the start of execution. Sort of like JSObjectMakeDate and JSObjectMakeRegExp. I'd like to see a patch that does that part for C and ObjC -- it's easy to get that right without solving the hard problem of how to get a data pointer.</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>