Closed Bug 807212 Opened 12 years ago Closed 12 years ago

Add JS_GetTypedArrayBuffer to jsfriendapi

Categories

(Core :: JavaScript Engine, defect)

18 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla19

People

(Reporter: roc, Assigned: roc)

Details

Attachments

(2 files)

It is inexplicably missing :-)
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/mozilla-central/rev/4d0cfc4fd49f
Status: NEW → RESOLVED
Closed: 12 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.

Attachment

General

Created:
Updated:
Size: