mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 737245 - Typed Arrays should handle cross-compartment wrappers; part3. r=luke
This commit is contained in:
parent
726caa9a7c
commit
d602c19f48
@ -210,7 +210,11 @@ class PythonJob(Job):
|
|||||||
if self.method not in m.__dict__:
|
if self.method not in m.__dict__:
|
||||||
print >>sys.stderr, "No method named '%s' in module %s" % (method, module)
|
print >>sys.stderr, "No method named '%s' in module %s" % (method, module)
|
||||||
return -127
|
return -127
|
||||||
m.__dict__[self.method](self.argv)
|
try:
|
||||||
|
m.__dict__[self.method](self.argv)
|
||||||
|
except TypeError:
|
||||||
|
print >> sys.stderr, "FAILED calling %r in %r" % (self.method, m)
|
||||||
|
raise
|
||||||
except PythonException, e:
|
except PythonException, e:
|
||||||
print >>sys.stderr, e
|
print >>sys.stderr, e
|
||||||
return e.exitcode
|
return e.exitcode
|
||||||
|
@ -2495,6 +2495,7 @@ JS_FRIEND_API(JSBool)
|
|||||||
js_IsArrayBuffer(JSObject *obj)
|
js_IsArrayBuffer(JSObject *obj)
|
||||||
{
|
{
|
||||||
JS_ASSERT(obj);
|
JS_ASSERT(obj);
|
||||||
|
obj = UnwrapObject(obj);
|
||||||
return obj->isArrayBuffer();
|
return obj->isArrayBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2531,6 +2532,7 @@ bool IsFastOrSlowTypedArray(JSObject *obj)
|
|||||||
uint32_t
|
uint32_t
|
||||||
JS_GetArrayBufferByteLength(JSObject *obj)
|
JS_GetArrayBufferByteLength(JSObject *obj)
|
||||||
{
|
{
|
||||||
|
obj = UnwrapObject(obj);
|
||||||
JS_ASSERT(obj->isArrayBuffer());
|
JS_ASSERT(obj->isArrayBuffer());
|
||||||
return obj->arrayBufferByteLength();
|
return obj->arrayBufferByteLength();
|
||||||
}
|
}
|
||||||
@ -2538,6 +2540,7 @@ JS_GetArrayBufferByteLength(JSObject *obj)
|
|||||||
uint8_t *
|
uint8_t *
|
||||||
JS_GetArrayBufferData(JSObject *obj)
|
JS_GetArrayBufferData(JSObject *obj)
|
||||||
{
|
{
|
||||||
|
obj = UnwrapObject(obj);
|
||||||
JS_ASSERT(obj->isArrayBuffer());
|
JS_ASSERT(obj->isArrayBuffer());
|
||||||
return obj->arrayBufferDataOffset();
|
return obj->arrayBufferDataOffset();
|
||||||
}
|
}
|
||||||
@ -2546,6 +2549,7 @@ JS_FRIEND_API(JSBool)
|
|||||||
js_IsTypedArray(JSObject *obj)
|
js_IsTypedArray(JSObject *obj)
|
||||||
{
|
{
|
||||||
JS_ASSERT(obj);
|
JS_ASSERT(obj);
|
||||||
|
obj = UnwrapObject(obj);
|
||||||
Class *clasp = obj->getClass();
|
Class *clasp = obj->getClass();
|
||||||
return IsFastTypedArrayClass(clasp);
|
return IsFastTypedArrayClass(clasp);
|
||||||
}
|
}
|
||||||
@ -2647,6 +2651,7 @@ js_CreateTypedArrayWithBuffer(JSContext *cx, int atype, JSObject *bufArg,
|
|||||||
uint32_t
|
uint32_t
|
||||||
JS_GetTypedArrayLength(JSObject *obj)
|
JS_GetTypedArrayLength(JSObject *obj)
|
||||||
{
|
{
|
||||||
|
obj = UnwrapObject(obj);
|
||||||
JS_ASSERT(obj->isTypedArray());
|
JS_ASSERT(obj->isTypedArray());
|
||||||
return obj->getSlot(TypedArray::FIELD_LENGTH).toInt32();
|
return obj->getSlot(TypedArray::FIELD_LENGTH).toInt32();
|
||||||
}
|
}
|
||||||
@ -2654,6 +2659,7 @@ JS_GetTypedArrayLength(JSObject *obj)
|
|||||||
uint32_t
|
uint32_t
|
||||||
JS_GetTypedArrayByteOffset(JSObject *obj)
|
JS_GetTypedArrayByteOffset(JSObject *obj)
|
||||||
{
|
{
|
||||||
|
obj = UnwrapObject(obj);
|
||||||
JS_ASSERT(obj->isTypedArray());
|
JS_ASSERT(obj->isTypedArray());
|
||||||
return obj->getSlot(TypedArray::FIELD_BYTEOFFSET).toInt32();
|
return obj->getSlot(TypedArray::FIELD_BYTEOFFSET).toInt32();
|
||||||
}
|
}
|
||||||
@ -2661,6 +2667,7 @@ JS_GetTypedArrayByteOffset(JSObject *obj)
|
|||||||
uint32_t
|
uint32_t
|
||||||
JS_GetTypedArrayByteLength(JSObject *obj)
|
JS_GetTypedArrayByteLength(JSObject *obj)
|
||||||
{
|
{
|
||||||
|
obj = UnwrapObject(obj);
|
||||||
JS_ASSERT(obj->isTypedArray());
|
JS_ASSERT(obj->isTypedArray());
|
||||||
return obj->getSlot(TypedArray::FIELD_BYTELENGTH).toInt32();
|
return obj->getSlot(TypedArray::FIELD_BYTELENGTH).toInt32();
|
||||||
}
|
}
|
||||||
@ -2668,6 +2675,7 @@ JS_GetTypedArrayByteLength(JSObject *obj)
|
|||||||
uint32_t
|
uint32_t
|
||||||
JS_GetTypedArrayType(JSObject *obj)
|
JS_GetTypedArrayType(JSObject *obj)
|
||||||
{
|
{
|
||||||
|
obj = UnwrapObject(obj);
|
||||||
JS_ASSERT(obj->isTypedArray());
|
JS_ASSERT(obj->isTypedArray());
|
||||||
return obj->getSlot(TypedArray::FIELD_TYPE).toInt32();
|
return obj->getSlot(TypedArray::FIELD_TYPE).toInt32();
|
||||||
}
|
}
|
||||||
@ -2675,6 +2683,7 @@ JS_GetTypedArrayType(JSObject *obj)
|
|||||||
void *
|
void *
|
||||||
JS_GetTypedArrayData(JSObject *obj)
|
JS_GetTypedArrayData(JSObject *obj)
|
||||||
{
|
{
|
||||||
|
obj = UnwrapObject(obj);
|
||||||
JS_ASSERT(obj->isTypedArray());
|
JS_ASSERT(obj->isTypedArray());
|
||||||
return TypedArray::getDataOffset(obj);
|
return TypedArray::getDataOffset(obj);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user