-
commit-queue@webkit.org authored
https://bugs.webkit.org/show_bug.cgi?id=67381 Patch by Kentaro Hara <haraken@google.com> on 2011-09-01 Reviewed by Darin Adler. The spec is here: http://www.w3.org/TR/WebIDL/#es-interface-call For example, "Image()" or "XMLHttpRequest()" should throw TypeError. Source/WebCore: Test: fast/dom/call-a-constructor-as-a-function.html * bindings/v8/custom/V8ArrayBufferCustom.cpp: (WebCore::V8ArrayBuffer::constructorCallback): Throws TypeError if args.IsConstructCall() is false. * bindings/v8/custom/V8ArrayBufferViewCustom.h: (WebCore::constructWebGLArray): Ditto. * bindings/v8/custom/V8AudioContextCustom.cpp: (WebCore::V8AudioContext::constructorCallback): Ditto. * bindings/v8/custom/V8DOMFormDataCustom.cpp: (WebCore::V8DOMFormData::constructorCallback): Ditto. * bindings/v8/custom/V8HTMLAudioElementConstructor.cpp: (WebCore::v8HTMLAudioElementConstructorCallback): Ditto. * bindings/v8/custom/V8HTMLImageElementConstructor.cpp: (WebCore::v8HTMLImageElementConstructorCallback): Ditto. * bindings/v8/custom/V8HTMLOptionElementConstructor.cpp: (WebCore::v8HTMLOptionElementConstructorCallback): Ditto. * bindings/v8/custom/V8MessageChannelConstructor.cpp: (WebCore::V8MessageChannel::constructorCallback): Ditto. * bindings/v8/custom/V8SharedWorkerCustom.cpp: (WebCore::V8SharedWorker::constructorCallback): Ditto. * bindings/v8/custom/V8WebKitCSSMatrixConstructor.cpp: (WebCore::V8WebKitCSSMatrix::constructorCallback): Ditto. * bindings/v8/custom/V8WebKitPointConstructor.cpp: (WebCore::V8WebKitPoint::constructorCallback): Ditto. * bindings/v8/custom/V8WebSocketCustom.cpp: (WebCore::V8WebSocket::constructorCallback): Ditto. * bindings/v8/custom/V8WorkerCustom.cpp: (WebCore::V8Worker::constructorCallback): Ditto. LayoutTests: * fast/dom/call-a-constructor-as-a-function-expected.txt: Added. The test result for JSC. * fast/dom/call-a-constructor-as-a-function.html: Added. Checks if TypeError is thrown. * platform/chromium/fast/dom/call-a-constructor-as-a-function-expected.txt: Added. The test result for V8. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22d7ea8a