<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#c33">Comment # 33</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@apple.com" title="Geoffrey Garen <ggaren@apple.com>"> <span class="fn">Geoffrey Garen</span></a>
</span></b>
<pre><span class="quote">> > While this follows the JSC naming scheme, it also makes the API a bit more
> > cumbersome to use: now, every time you want to get the data pointer or type
> > of a typed array, you first have to check if the JSValueRef you got in your
> > function call is a JSObjectRef (using JSValueIsObject()). Allowing for
> > JSValues to be passed into these functions (i.e.
> > "JSValueGetTypedArrayDataPtr") would be much more convenient, but also not
> > reflect the truth that a Typed Array is a JSObject, not a JSValue.
>
> Yeah. Personally, I would not object to JSValueGetTypedArrayType in
> addition to JSObjectGetTypedArrayType, particularly since
> JSValueGetTypedArrayType has a very obvious spec and could even be
> implemented in terms of the other APIs.</span >
The fact that JSObject is separate from JSValue, requiring a type check and cast before use, is a mistake, which is fixed in the modern Objective-C API. But I think it's good to adhere to the mistake in the C API so that the API remains internally consistent.
It's easy for clients to fix the mistake by writing their own 2 line JSValue wrappers for JSObject functions, and indeed that's what we do in WebKit.</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>