inline ArrayBuffer* toArrayBufferView(JSValue value) { JSArrayBufferView* wrapper = jsDynamicCast<JSArrayBufferView*>(value); if (!wrapper) return 0; return wrapper->buffer(); }
void JSArrayBufferView::visitChildren(JSCell* cell, SlotVisitor& visitor) { JSArrayBufferView* thisObject = jsCast<JSArrayBufferView*>(cell); if (thisObject->hasArrayBuffer()) { ArrayBuffer* buffer = thisObject->buffer(); RELEASE_ASSERT(buffer); visitor.addOpaqueRoot(buffer); } Base::visitChildren(thisObject, visitor); }
bool JSArrayBufferView::getOwnPropertySlot( JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot) { JSArrayBufferView* thisObject = jsCast<JSArrayBufferView*>(object); if (propertyName == exec->propertyNames().byteOffset) { slot.setValue(thisObject, DontDelete | ReadOnly, jsNumber(thisObject->byteOffset())); return true; } if (propertyName == exec->propertyNames().buffer) { slot.setValue( thisObject, DontDelete | ReadOnly, exec->vm().m_typedArrayController->toJS( exec, thisObject->globalObject(), thisObject->buffer())); return true; } return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot); }