Add JS_GetTypedArrayBuffer to jsfriendapi

RESOLVED FIXED in mozilla19

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: roc, Assigned: roc)

Tracking

18 Branch
mozilla19
x86_64
Windows 7
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

It is inexplicably missing :-)
Created attachment 676898 [details] [diff] [review]
Add JS_GetTypedArrayBuffer
Attachment #676898 - Flags: review?(sphink)
Created attachment 676900 [details] [diff] [review]
Use TypedArray methods instead of direct slot access

Drive-by cleanup, which may also make these functions a tiny bit more efficient.
Attachment #676900 - Flags: review?(sphink)
Comment on attachment 676900 [details] [diff] [review]
Use TypedArray methods instead of direct slot access

Review of attachment 676900 [details] [diff] [review]:
-----------------------------------------------------------------

Yeah, efaust cooked up those JS_GetObjectAs* methods for bz and slipped it in when I was on vacation. :-) I like your cleanup, thanks.
Attachment #676900 - Flags: review?(sphink) → review+
Comment on attachment 676898 [details] [diff] [review]
Add JS_GetTypedArrayBuffer

Review of attachment 676898 [details] [diff] [review]:
-----------------------------------------------------------------

Please call this JS_GetArrayBufferViewBuffer so it works for DataViews as well, and test it.

Or what I'm really saying: just steal my patch from bug 807223 and review it yourself. I think it's fine to land then without further review.

::: js/src/jstypedarray.cpp
@@ +3707,5 @@
> +    obj = CheckedUnwrap(maybecx, obj);
> +    if (!obj)
> +        return nullptr;
> +    JS_ASSERT(obj->isTypedArray());
> +    return obj->getFixedSlot(TypedArray::BUFFER_SLOT).toInt32();

You probably didn't mean .toInt32().
Attachment #676898 - Flags: review?(sphink) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/95187d8e170c
https://hg.mozilla.org/integration/mozilla-inbound/rev/4d0cfc4fd49f
https://hg.mozilla.org/mozilla-central/rev/4d0cfc4fd49f
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in before you can comment on or make changes to this bug.