Bug 1077354 - Allow CTypes to pass DataView argumets as pointers r=terrence
authorJon Coppeard <jcoppeard@mozilla.com>
Thu, 08 Jan 2015 11:31:13 +0000
changeset 248569 b45b110029225e98625bd7435d42c18bbb1e2f26
parent 248568 88d447a05ed486afa5c3696a4f5e1bd211188206
child 248570 e6ac6c211626ef78876625431e214df72f1f22ca
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs1077354
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1077354 - Allow CTypes to pass DataView argumets as pointers r=terrence
js/src/ctypes/CTypes.cpp
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -2459,17 +2459,17 @@ ImplicitConvert(JSContext* cx,
           JS::AutoCheckCannotGC nogc;
           ptr = JS_GetArrayBufferData(valObj, nogc);
       }
       if (!ptr) {
         return TypeError(cx, "arraybuffer pointer", val);
       }
       *static_cast<void**>(buffer) = ptr;
       break;
-    } if (val.isObject() && JS_IsTypedArrayObject(valObj)) {
+    } if (val.isObject() && JS_IsArrayBufferViewObject(valObj)) {
       // Same as ArrayBuffer, above, though note that this will take the offset
       // of the view into account.
       if(!CanConvertTypedArrayItemTo(baseType, valObj, cx)) {
         return TypeError(cx, "typed array with the appropriate type", val);
       }
       void* ptr;
       {
           JS::AutoCheckCannotGC nogc;