Title: [93336] trunk
- Revision
- 93336
- Author
- [email protected]
- Date
- 2011-08-18 12:43:13 -0700 (Thu, 18 Aug 2011)
Log Message
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 <[email protected]> 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.
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (93335 => 93336)
--- trunk/LayoutTests/ChangeLog 2011-08-18 19:32:13 UTC (rev 93335)
+++ trunk/LayoutTests/ChangeLog 2011-08-18 19:43:13 UTC (rev 93336)
@@ -1,3 +1,14 @@
+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
+
+ Reviewed by Adam Barth.
+
+ Spec is here: http://www.w3.org/TR/WebIDL/#es-operations.
+
+ * fast/workers/worker-constructor-expected.txt: Changed SyntaxError to TypeError.
+
2011-08-18 Ryosuke Niwa <[email protected]>
Add a test to ensure WebKit does not paste contents before
Modified: trunk/LayoutTests/fast/workers/worker-constructor-expected.txt (93335 => 93336)
--- trunk/LayoutTests/fast/workers/worker-constructor-expected.txt 2011-08-18 19:32:13 UTC (rev 93335)
+++ trunk/LayoutTests/fast/workers/worker-constructor-expected.txt 2011-08-18 19:43:13 UTC (rev 93336)
@@ -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 Worker constructor without arguments resulted in an exception (SyntaxError: Not enough arguments)
+PASS: invoking Worker constructor without arguments resulted in an exception (TypeError: Not enough arguments)
PASS: invoking Worker constructor with empty script URL resulted in an exception (Error: SYNTAX_ERR: DOM Exception 12)
PASS: invoking Worker constructor with invalid script URL resulted in an exception (Error: SYNTAX_ERR: DOM Exception 12)
PASS: onerror invoked for a script that could not be loaded.
Modified: trunk/Source/WebCore/ChangeLog (93335 => 93336)
--- trunk/Source/WebCore/ChangeLog 2011-08-18 19:32:13 UTC (rev 93335)
+++ trunk/Source/WebCore/ChangeLog 2011-08-18 19:43:13 UTC (rev 93336)
@@ -1,3 +1,19 @@
+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
+
+ Reviewed by Adam Barth.
+
+ Spec is here: http://www.w3.org/TR/WebIDL/#es-operations.
+
+ 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.
+
2011-08-18 John Bates <[email protected]>
Fix logic error causing reverse of desired WebGL rate limiting behavior
Modified: trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp (93335 => 93336)
--- trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp 2011-08-18 19:32:13 UTC (rev 93335)
+++ trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp 2011-08-18 19:43:13 UTC (rev 93336)
@@ -49,7 +49,7 @@
JSWorkerConstructor* jsConstructor = static_cast<JSWorkerConstructor*>(exec->callee());
if (!exec->argumentCount())
- return throwVMError(exec, createSyntaxError(exec, "Not enough arguments"));
+ return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
UString scriptURL = exec->argument(0).toString(exec);
if (exec->hadException())
Modified: trunk/Source/WebCore/bindings/v8/custom/V8WorkerCustom.cpp (93335 => 93336)
--- trunk/Source/WebCore/bindings/v8/custom/V8WorkerCustom.cpp 2011-08-18 19:32:13 UTC (rev 93335)
+++ trunk/Source/WebCore/bindings/v8/custom/V8WorkerCustom.cpp 2011-08-18 19:43:13 UTC (rev 93336)
@@ -55,7 +55,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