summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/js/JSWebGLArrayBufferConstructor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/js/JSWebGLArrayBufferConstructor.cpp')
-rw-r--r--WebCore/bindings/js/JSWebGLArrayBufferConstructor.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/WebCore/bindings/js/JSWebGLArrayBufferConstructor.cpp b/WebCore/bindings/js/JSWebGLArrayBufferConstructor.cpp
index 9742db7..8671908 100644
--- a/WebCore/bindings/js/JSWebGLArrayBufferConstructor.cpp
+++ b/WebCore/bindings/js/JSWebGLArrayBufferConstructor.cpp
@@ -30,7 +30,6 @@
#include "JSWebGLArrayBufferConstructor.h"
#include "Document.h"
-#include "WebGLArrayBuffer.h"
#include "JSWebGLArrayBuffer.h"
namespace WebCore {
@@ -56,7 +55,12 @@ static JSObject* constructCanvasArrayBuffer(ExecState* exec, JSObject* construct
if (isnan(size))
size = 0;
}
- return asObject(toJS(exec, jsConstructor->globalObject(), WebGLArrayBuffer::create(size)));
+ RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(size, 1);
+ if (!buffer.get()){
+ setDOMException(exec, INDEX_SIZE_ERR);
+ return 0;
+ }
+ return asObject(toJS(exec, jsConstructor->globalObject(), buffer.get()));
}
JSC::ConstructType JSWebGLArrayBufferConstructor::getConstructData(JSC::ConstructData& constructData)