summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/v8/custom/V8WebGLArrayBufferCustom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/v8/custom/V8WebGLArrayBufferCustom.cpp')
-rw-r--r--WebCore/bindings/v8/custom/V8WebGLArrayBufferCustom.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/WebCore/bindings/v8/custom/V8WebGLArrayBufferCustom.cpp b/WebCore/bindings/v8/custom/V8WebGLArrayBufferCustom.cpp
index 5b54563..d3e6cb5 100644
--- a/WebCore/bindings/v8/custom/V8WebGLArrayBufferCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WebGLArrayBufferCustom.cpp
@@ -72,9 +72,13 @@ v8::Handle<v8::Value> V8WebGLArrayBuffer::constructorCallback(const v8::Argument
len = toInt32(args[0]);
}
- RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(len);
+ RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(len, 1);
+ if (!buffer.get()) {
+ V8Proxy::setDOMException(INDEX_SIZE_ERR);
+ return v8::Undefined();
+ }
// Transform the holder into a wrapper object for the array.
- V8DOMWrapper::setDOMWrapper(args.Holder(), V8ClassIndex::ToInt(V8ClassIndex::WEBGLARRAYBUFFER), buffer.get());
+ V8DOMWrapper::setDOMWrapper(args.Holder(), &info, buffer.get());
return toV8(buffer.release(), args.Holder());
}