Title: [93339] trunk
Revision
93339
Author
[email protected]
Date
2011-08-18 13:09:13 -0700 (Thu, 18 Aug 2011)

Log Message

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

Patch by Kentaro Hara <[email protected]> on 2011-08-18
Reviewed by Adam Barth.

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

Source/WebCore:

Test: fast/workers/shared-worker-constructor.html

* bindings/js/JSSharedWorkerCustom.cpp:
(WebCore::JSSharedWorkerConstructor::constructJSSharedWorker): Changed SyntaxError to TypeError.
* bindings/v8/custom/V8SharedWorkerCustom.cpp:
(WebCore::V8SharedWorker::constructorCallback): Changed SyntaxError to TypeError.

LayoutTests:

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

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (93338 => 93339)


--- trunk/LayoutTests/ChangeLog	2011-08-18 20:08:04 UTC (rev 93338)
+++ trunk/LayoutTests/ChangeLog	2011-08-18 20:09:13 UTC (rev 93339)
@@ -1,5 +1,16 @@
 2011-08-18  Kentaro Hara  <[email protected]>
 
+        A SharedWorker constructor should throw TypeError, when the number of arguments is not enough.
+        https://bugs.webkit.org/show_bug.cgi?id=66455
+
+        Reviewed by Adam Barth.
+
+        The spec is here: http://www.w3.org/TR/WebIDL/#es-operations.
+
+        * fast/workers/shared-worker-constructor-expected.txt: Changed SyntaxError to TypeError.
+
+2011-08-18  Kentaro Hara  <[email protected]>
+
         A Worker constructor should throw TypeError, when the number of arguments is not enough
         https://bugs.webkit.org/show_bug.cgi?id=66456
 

Modified: trunk/LayoutTests/fast/workers/shared-worker-constructor-expected.txt (93338 => 93339)


--- trunk/LayoutTests/fast/workers/shared-worker-constructor-expected.txt	2011-08-18 20:08:04 UTC (rev 93338)
+++ trunk/LayoutTests/fast/workers/shared-worker-constructor-expected.txt	2011-08-18 20:09:13 UTC (rev 93339)
@@ -2,7 +2,7 @@
 
 PASS: toString exception propagated correctly.
 PASS: trying to create workers recursively resulted in an exception (RangeError: Maximum call stack size exceeded.)
-PASS: invoking SharedWorker constructor without arguments resulted in an exception (SyntaxError: Not enough arguments)
+PASS: invoking SharedWorker constructor without arguments resulted in an exception (TypeError: Not enough arguments)
 PASS: invoking SharedWorker constructor without name did not result in an exception
 PASS: SharedWorker constructor succeeded: [object SharedWorker]
 DONE

Modified: trunk/Source/WebCore/ChangeLog (93338 => 93339)


--- trunk/Source/WebCore/ChangeLog	2011-08-18 20:08:04 UTC (rev 93338)
+++ trunk/Source/WebCore/ChangeLog	2011-08-18 20:09:13 UTC (rev 93339)
@@ -1,3 +1,19 @@
+2011-08-18  Kentaro Hara  <[email protected]>
+
+        A SharedWorker constructor should throw TypeError, when the number of arguments is not enough.
+        https://bugs.webkit.org/show_bug.cgi?id=66455
+
+        Reviewed by Adam Barth.
+
+        The spec is here: http://www.w3.org/TR/WebIDL/#es-operations.
+
+        Test: fast/workers/shared-worker-constructor.html
+
+        * bindings/js/JSSharedWorkerCustom.cpp:
+        (WebCore::JSSharedWorkerConstructor::constructJSSharedWorker): Changed SyntaxError to TypeError.
+        * bindings/v8/custom/V8SharedWorkerCustom.cpp:
+        (WebCore::V8SharedWorker::constructorCallback): Changed SyntaxError to TypeError.
+
 2011-08-17  Alejandro G. Castro  <[email protected]>
 
         [GTK] Fix compilation problems with deprecations in gtk+

Modified: trunk/Source/WebCore/bindings/js/JSSharedWorkerCustom.cpp (93338 => 93339)


--- trunk/Source/WebCore/bindings/js/JSSharedWorkerCustom.cpp	2011-08-18 20:08:04 UTC (rev 93338)
+++ trunk/Source/WebCore/bindings/js/JSSharedWorkerCustom.cpp	2011-08-18 20:09:13 UTC (rev 93339)
@@ -59,7 +59,7 @@
     JSSharedWorkerConstructor* jsConstructor = static_cast<JSSharedWorkerConstructor*>(exec->callee());
 
     if (exec->argumentCount() < 1)
-        return throwVMError(exec, createSyntaxError(exec, "Not enough arguments"));
+        return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
 
     UString scriptURL = exec->argument(0).toString(exec);
     UString name;

Modified: trunk/Source/WebCore/bindings/v8/custom/V8SharedWorkerCustom.cpp (93338 => 93339)


--- trunk/Source/WebCore/bindings/v8/custom/V8SharedWorkerCustom.cpp	2011-08-18 20:08:04 UTC (rev 93338)
+++ trunk/Source/WebCore/bindings/v8/custom/V8SharedWorkerCustom.cpp	2011-08-18 20:09:13 UTC (rev 93339)
@@ -52,7 +52,7 @@
         return throwError("DOM object constructor cannot be called as a function.");
 
     if (!args.Length())
-        return throwError("Not enough arguments", V8Proxy::SyntaxError);
+        return throwError("Not enough arguments", V8Proxy::TypeError);
 
     v8::TryCatch tryCatch;
     v8::Handle<v8::String> scriptUrl = args[0]->ToString();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to