A Worker constructor should throw TypeError, when the number of arguments is not enough
https://bugs.webkit.org/show_bug.cgi?id=66456

Patch by Kentaro Hara <haraken@google.com> on 2011-08-18
Reviewed by Adam Barth.

Spec is here: http://www.w3.org/TR/WebIDL/#es-operations.

Source/WebCore:

Test: fast/workers/worker-constructor.html

* bindings/js/JSWorkerCustom.cpp:
(WebCore::JSWorkerConstructor::constructJSWorker): Changed SyntaxError to TypeError.
* bindings/v8/custom/V8WorkerCustom.cpp:
(WebCore::V8Worker::constructorCallback): Changed SyntaxError to TypeError.

LayoutTests:

* fast/workers/worker-constructor-expected.txt: Changed SyntaxError to TypeError.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@93336 268f45cc-cd09-0410-ab3c-d52691b4dbfc
5 files changed