Changeset 51785 in webkit
- Timestamp:
- Dec 7, 2009 11:36:34 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r51784 r51785 1 2009-12-07 Kenneth Russell <kbr@google.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 [v8] WebCore::WebGLArrayBufferInternal::byteLengthAttrGetter NULL pointer 6 https://bugs.webkit.org/show_bug.cgi?id=31889 7 8 Fixed bug in handling of zero-argument constructor call. 9 10 Test: fast/canvas/webgl/bug-31889.html 11 12 * fast/canvas/webgl/bug-31889-expected.txt: Added. 13 * fast/canvas/webgl/bug-31889.html: Added. 14 1 15 2009-12-07 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> 2 16 -
trunk/WebCore/ChangeLog
r51783 r51785 1 2009-12-07 Kenneth Russell <kbr@google.com> 2 3 Reviewed by Dimitri Glazkov. 4 5 [v8] WebCore::WebGLArrayBufferInternal::byteLengthAttrGetter NULL pointer 6 https://bugs.webkit.org/show_bug.cgi?id=31889 7 8 Fixed bug in handling of zero-argument constructor call. 9 10 Test: fast/canvas/webgl/bug-31889.html 11 12 * bindings/v8/custom/V8WebGLArrayBufferCustom.cpp: 13 (WebCore::CALLBACK_FUNC_DECL): 14 1 15 2009-12-07 Gyuyoung Kim <gyuyoung@gmail.com> 2 16 -
trunk/WebCore/bindings/v8/custom/V8WebGLArrayBufferCustom.cpp
r51049 r51785 49 49 return throwError("DOM object constructor cannot be called as a function."); 50 50 51 int argLen = args.Length(); 52 if (argLen == 0) { 53 // This happens when we return a previously constructed 54 // WebGLArrayBuffer, e.g. from the call to WebGLArray.buffer. 55 // The V8DOMWrapper will set the internal pointer in the 56 // created object. Unfortunately it doesn't look like it's 57 // possible to distinguish between this case and that where 58 // the user calls "new WebGLArrayBuffer()" from JavaScript. 59 return args.Holder(); 60 } 51 // If we return a previously constructed WebGLArrayBuffer, 52 // e.g. from the call to WebGLArray.buffer, this code is called 53 // with a zero-length argument list. The V8DOMWrapper will then 54 // set the internal pointer in the newly-created object. 55 // Unfortunately it doesn't look like it's possible to distinguish 56 // between this case and that where the user calls "new 57 // WebGLArrayBuffer()" from JavaScript. To guard against problems, 58 // we always create at least a zero-length WebGLArrayBuffer, even 59 // if it is immediately overwritten by the V8DOMWrapper. 61 60 62 61 // Supported constructors: … … 64 63 // -- create an empty buffer of n bytes 65 64 66 if (argLen != 1) 65 int argLen = args.Length(); 66 if (argLen > 1) 67 67 return throwError("Wrong number of arguments specified to constructor (requires 1)"); 68 68 69 69 int len = 0; 70 if (!args[0]->IsInt32()) 71 return throwError("Argument to WebGLArrayBuffer constructor was not an integer"); 72 len = toInt32(args[0]); 70 if (argLen > 0) { 71 if (!args[0]->IsInt32()) 72 return throwError("Argument to WebGLArrayBuffer constructor was not an integer"); 73 len = toInt32(args[0]); 74 } 75 73 76 RefPtr<WebGLArrayBuffer> buffer = WebGLArrayBuffer::create(len); 74 77 // Transform the holder into a wrapper object for the array.
Note: See TracChangeset
for help on using the changeset viewer.