mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 993889 part 5. Remove the "creator" argument of the version of TypedArray::Create that takes a JSObject* creator. r=bholley
This commit is contained in:
parent
adc450e8a7
commit
e233bf14f8
@ -52,8 +52,8 @@ ImageData::Constructor(const GlobalObject& aGlobal,
|
||||
aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
JS::Rooted<JSObject*> obj(aGlobal.GetContext(), aGlobal.Get());
|
||||
JSObject* data = Uint8ClampedArray::Create(aGlobal.GetContext(), obj,
|
||||
js::AssertSameCompartment(aGlobal.GetContext(), aGlobal.Get());
|
||||
JSObject* data = Uint8ClampedArray::Create(aGlobal.GetContext(),
|
||||
length.value());
|
||||
if (!data) {
|
||||
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
|
@ -132,24 +132,17 @@ struct TypedArray : public TypedArray_base<T,UnboxArray> {
|
||||
ac.construct(cx, creatorWrapper);
|
||||
}
|
||||
|
||||
return CreateCommon(cx, creatorWrapper, length, data);
|
||||
return CreateCommon(cx, length, data);
|
||||
}
|
||||
|
||||
static inline JSObject*
|
||||
Create(JSContext* cx, JS::Handle<JSObject*> creator, uint32_t length,
|
||||
const T* data = nullptr) {
|
||||
Maybe<JSAutoCompartment> ac;
|
||||
if (creator) {
|
||||
ac.construct(cx, creator);
|
||||
}
|
||||
|
||||
return CreateCommon(cx, creator, length, data);
|
||||
Create(JSContext* cx, uint32_t length, const T* data = nullptr) {
|
||||
return CreateCommon(cx, length, data);
|
||||
}
|
||||
|
||||
private:
|
||||
static inline JSObject*
|
||||
CreateCommon(JSContext* cx, JS::Handle<JSObject*> creator, uint32_t length,
|
||||
const T* data) {
|
||||
CreateCommon(JSContext* cx, uint32_t length, const T* data) {
|
||||
JSObject* obj = CreateNew(cx, length);
|
||||
if (!obj) {
|
||||
return nullptr;
|
||||
|
@ -75,7 +75,8 @@ TextEncoder::Encode(JSContext* aCx,
|
||||
JSObject* outView = nullptr;
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
buf[dstLen] = '\0';
|
||||
outView = Uint8Array::Create(aCx, aObj, dstLen,
|
||||
JSAutoCompartment ac(aCx, aObj);
|
||||
outView = Uint8Array::Create(aCx, dstLen,
|
||||
reinterpret_cast<uint8_t*>(buf.get()));
|
||||
if (!outView) {
|
||||
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
|
||||
|
Loading…
Reference in New Issue
Block a user