EncodedJSValue JSC_HOST_CALL JSInt8ArrayConstructor::constructJSInt8Array(ExecState* exec) { JSInt8ArrayConstructor* jsConstructor = static_cast<JSInt8ArrayConstructor*>(exec->callee()); RefPtr<Int8Array> array = static_cast<Int8Array*>(constructArrayBufferView<Int8Array, signed char>(exec).get()); if (!array.get()) // Exception has already been thrown. return JSValue::encode(JSValue()); return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), array.get()))); }
static JSObject* constructCanvasByteArray(ExecState* exec, JSObject* constructor, const ArgList& args) { JSInt8ArrayConstructor* jsConstructor = static_cast<JSInt8ArrayConstructor*>(constructor); RefPtr<Int8Array> array = static_cast<Int8Array*>(construct<Int8Array, signed char>(exec, args).get()); if (!array.get()) { setDOMException(exec, INDEX_SIZE_ERR); return 0; } return asObject(toJS(exec, jsConstructor->globalObject(), array.get())); }