зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1673604 part 8 - Make ArrayBufferViewObject::bufferValue non-static. r=anba
For consistency with the other fooValue methods. Differential Revision: https://phabricator.services.mozilla.com/D94952
This commit is contained in:
Родитель
c7946dc527
Коммит
b88a38837f
|
@ -885,7 +885,7 @@ bool DataViewObject::fun_setFloat64(JSContext* cx, unsigned argc, Value* vp) {
|
|||
bool DataViewObject::bufferGetterImpl(JSContext* cx, const CallArgs& args) {
|
||||
Rooted<DataViewObject*> thisView(
|
||||
cx, &args.thisv().toObject().as<DataViewObject>());
|
||||
args.rval().set(DataViewObject::bufferValue(thisView));
|
||||
args.rval().set(thisView->bufferValue());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -100,10 +100,8 @@ class ArrayBufferViewObject : public NativeObject {
|
|||
return dataPointerEither_();
|
||||
}
|
||||
|
||||
static Value bufferValue(const ArrayBufferViewObject* view) {
|
||||
return view->getFixedSlot(BUFFER_SLOT);
|
||||
}
|
||||
bool hasBuffer() const { return bufferValue(this).isObject(); }
|
||||
Value bufferValue() const { return getFixedSlot(BUFFER_SLOT); }
|
||||
bool hasBuffer() const { return bufferValue().isObject(); }
|
||||
|
||||
ArrayBufferObject* bufferUnshared() const {
|
||||
MOZ_ASSERT(!isSharedMemory());
|
||||
|
@ -122,7 +120,7 @@ class ArrayBufferViewObject : public NativeObject {
|
|||
return &obj->as<SharedArrayBufferObject>();
|
||||
}
|
||||
ArrayBufferObjectMaybeShared* bufferEither() const {
|
||||
JSObject* obj = bufferValue(this).toObjectOrNull();
|
||||
JSObject* obj = bufferValue().toObjectOrNull();
|
||||
if (!obj) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -1199,7 +1199,7 @@ static bool intrinsic_TypedArrayBuffer(JSContext* cx, unsigned argc,
|
|||
return false;
|
||||
}
|
||||
|
||||
args.rval().set(TypedArrayObject::bufferValue(tarray));
|
||||
args.rval().set(tarray->bufferValue());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1271,7 +1271,7 @@ bool JSStructuredCloneWriter::writeTypedArray(HandleObject obj) {
|
|||
}
|
||||
|
||||
// Write out the ArrayBuffer tag and contents
|
||||
RootedValue val(context(), TypedArrayObject::bufferValue(tarr));
|
||||
RootedValue val(context(), tarr->bufferValue());
|
||||
if (!startWrite(val)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1288,7 +1288,7 @@ bool JSStructuredCloneWriter::writeDataView(HandleObject obj) {
|
|||
}
|
||||
|
||||
// Write out the ArrayBuffer tag and contents
|
||||
RootedValue val(context(), DataViewObject::bufferValue(view));
|
||||
RootedValue val(context(), view->bufferValue());
|
||||
if (!startWrite(val)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1649,7 +1649,7 @@ static bool BufferGetterImpl(JSContext* cx, const CallArgs& args) {
|
|||
if (!TypedArrayObject::ensureHasBuffer(cx, tarray)) {
|
||||
return false;
|
||||
}
|
||||
args.rval().set(TypedArrayObject::bufferValue(tarray));
|
||||
args.rval().set(tarray->bufferValue());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче