diff options
Diffstat (limited to 'WebCore/bindings/v8/custom/V8WebGLUnsignedShortArrayCustom.cpp')
-rw-r--r-- | WebCore/bindings/v8/custom/V8WebGLUnsignedShortArrayCustom.cpp | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/WebCore/bindings/v8/custom/V8WebGLUnsignedShortArrayCustom.cpp b/WebCore/bindings/v8/custom/V8WebGLUnsignedShortArrayCustom.cpp index ce261e9..d9e47cd 100644 --- a/WebCore/bindings/v8/custom/V8WebGLUnsignedShortArrayCustom.cpp +++ b/WebCore/bindings/v8/custom/V8WebGLUnsignedShortArrayCustom.cpp @@ -44,48 +44,20 @@ namespace WebCore { -CALLBACK_FUNC_DECL(WebGLUnsignedShortArrayConstructor) +v8::Handle<v8::Value> V8WebGLUnsignedShortArray::constructorCallback(const v8::Arguments& args) { INC_STATS("DOM.WebGLUnsignedShortArray.Contructor"); return constructWebGLArray<WebGLUnsignedShortArray>(args, V8ClassIndex::ToInt(V8ClassIndex::WEBGLUNSIGNEDSHORTARRAY)); } -// Get the specified value from the array and return it wrapped as a JavaScript Number object to V8. Accesses outside the valid array range return "undefined". -INDEXED_PROPERTY_GETTER(WebGLUnsignedShortArray) -{ - INC_STATS("DOM.WebGLUnsignedShortArray.IndexedPropertyGetter"); - WebGLUnsignedShortArray* array = V8DOMWrapper::convertToNativeObject<WebGLUnsignedShortArray>(V8ClassIndex::WEBGLUNSIGNEDSHORTARRAY, info.Holder()); - - if ((index < 0) || (index >= array->length())) - return v8::Undefined(); - unsigned short result; - if (!array->get(index, result)) - return v8::Undefined(); - return v8::Number::New(result); -} - -// Set the specified value in the array. Accesses outside the valid array range are silently ignored. -INDEXED_PROPERTY_SETTER(WebGLUnsignedShortArray) -{ - INC_STATS("DOM.WebGLUnsignedShortArray.IndexedPropertySetter"); - WebGLUnsignedShortArray* array = V8DOMWrapper::convertToNativeObject<WebGLUnsignedShortArray>(V8ClassIndex::WEBGLUNSIGNEDSHORTARRAY, info.Holder()); - - if ((index >= 0) && (index < array->length())) { - if (!value->IsNumber()) - return throwError("Could not convert value argument to a number"); - array->set(index, value->NumberValue()); - } - return value; -} - -CALLBACK_FUNC_DECL(WebGLUnsignedShortArrayGet) +v8::Handle<v8::Value> V8WebGLUnsignedShortArray::getCallback(const v8::Arguments& args) { INC_STATS("DOM.WebGLUnsignedShortArray.get()"); return getWebGLArrayElement<WebGLUnsignedShortArray, unsigned short>(args, V8ClassIndex::WEBGLUNSIGNEDSHORTARRAY); } -CALLBACK_FUNC_DECL(WebGLUnsignedShortArraySet) +v8::Handle<v8::Value> V8WebGLUnsignedShortArray::setCallback(const v8::Arguments& args) { INC_STATS("DOM.WebGLUnsignedShortArray.set()"); return setWebGLArray<WebGLUnsignedShortArray, V8WebGLUnsignedShortArray>(args, V8ClassIndex::WEBGLUNSIGNEDSHORTARRAY); |