2727#ifndef JSArrayBufferViewHelper_h
2828#define JSArrayBufferViewHelper_h
2929
30- #include " ExceptionCode.h"
3130#include " JSArrayBuffer.h"
32- #include " JSDOMBinding.h"
3331#include < interpreter/CallFrame.h>
3432#include < runtime/ArgList.h>
3533#include < runtime/Error.h>
3634#include < runtime/JSObject.h>
3735#include < runtime/JSValue.h>
3836#include < wtf/ArrayBufferView.h>
3937
40- namespace JSC {
38+ namespace WebCore {
4139
4240template <class T >
4341JSC::JSValue setWebGLArrayHelper (JSC::ExecState* exec, T* impl, T* (*conversionFunc)(JSC::JSValue))
@@ -52,7 +50,7 @@ JSC::JSValue setWebGLArrayHelper(JSC::ExecState* exec, T* impl, T* (*conversionF
5250 if (exec->argumentCount () == 2 )
5351 offset = exec->argument (1 ).toInt32 (exec);
5452 if (!impl->set (array, offset))
55- setDOMException (exec, INDEX_SIZE_ERR );
53+ throwTypeError (exec);
5654
5755 return JSC::jsUndefined ();
5856 }
@@ -67,7 +65,7 @@ JSC::JSValue setWebGLArrayHelper(JSC::ExecState* exec, T* impl, T* (*conversionF
6765 if (offset > impl->length ()
6866 || offset + length > impl->length ()
6967 || offset + length < offset)
70- setDOMException (exec, INDEX_SIZE_ERR );
68+ throwTypeError (exec);
7169 else {
7270 for (uint32_t i = 0 ; i < length; i++) {
7371 JSC::JSValue v = array->get (exec, i);
@@ -105,7 +103,7 @@ PassRefPtr<C> constructArrayBufferViewWithArrayBufferArgument(JSC::ExecState* ex
105103 }
106104 RefPtr<C> array = C::create (buffer, offset, length);
107105 if (!array)
108- setDOMException (exec, INDEX_SIZE_ERR );
106+ throwTypeError (exec);
109107 return array;
110108}
111109
@@ -142,7 +140,7 @@ PassRefPtr<C> constructArrayBufferView(JSC::ExecState* exec)
142140 uint32_t length = srcArray->get (exec, JSC::Identifier (exec, " length" )).toUInt32 (exec);
143141 RefPtr<C> array = C::create (length);
144142 if (!array) {
145- setDOMException (exec, INDEX_SIZE_ERR );
143+ throwTypeError (exec);
146144 return array;
147145 }
148146
@@ -163,16 +161,15 @@ PassRefPtr<C> constructArrayBufferView(JSC::ExecState* exec)
163161}
164162
165163template <typename JSType, typename WebCoreType>
166- static JSC::JSValue toJSArrayBufferView (JSC::ExecState* exec, JSDOMGlobalObject * globalObject, WebCoreType* object)
164+ static JSC::JSValue toJSArrayBufferView (JSC::ExecState* exec, JSC::JSGlobalObject * globalObject, WebCoreType* object)
167165{
166+ ASSERT_UNUSED (globalObject, globalObject);
168167 if (!object)
169168 return JSC::jsNull ();
170-
171- if (JSDOMWrapper* wrapper = getCachedWrapper (currentWorld (exec), object))
172- return wrapper;
173-
174- exec->heap ()->reportExtraMemoryCost (object->byteLength ());
175- return createWrapper<JSType>(exec, globalObject, object);
169+
170+ exec->heap ()->reportExtraMemoryCost (object->byteLength ());
171+ JSC::JSCell* jsCell = reinterpret_cast <JSC::JSCell*>(object);
172+ return jsCell;
176173}
177174
178175} // namespace WebCore
0 commit comments