Title: [93340] trunk
- Revision
- 93340
- Author
- [email protected]
- Date
- 2011-08-18 13:11:24 -0700 (Thu, 18 Aug 2011)
Log Message
An EventSource constructor should throw TypeError, when the number of arguments is not enough.
https://bugs.webkit.org/show_bug.cgi?id=66454
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/eventsource/eventsource-constructor.html
* bindings/js/JSEventSourceCustom.cpp:
(WebCore::JSEventSourceConstructor::constructJSEventSource): Changed SyntaxError to TypeError.
* bindings/v8/custom/V8EventSourceConstructor.cpp:
(WebCore::V8EventSource::constructorCallback): Changed SyntaxError to TypeError.
LayoutTests:
* fast/eventsource/eventsource-constructor-expected.txt: Changed SyntaxError to TypeError.
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (93339 => 93340)
--- trunk/LayoutTests/ChangeLog 2011-08-18 20:09:13 UTC (rev 93339)
+++ trunk/LayoutTests/ChangeLog 2011-08-18 20:11:24 UTC (rev 93340)
@@ -1,5 +1,16 @@
2011-08-18 Kentaro Hara <[email protected]>
+ An EventSource constructor should throw TypeError, when the number of arguments is not enough.
+ https://bugs.webkit.org/show_bug.cgi?id=66454
+
+ Reviewed by Adam Barth.
+
+ The spec is here: http://www.w3.org/TR/WebIDL/#es-operations.
+
+ * fast/eventsource/eventsource-constructor-expected.txt: Changed SyntaxError to TypeError.
+
+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
Modified: trunk/LayoutTests/fast/eventsource/eventsource-constructor-expected.txt (93339 => 93340)
--- trunk/LayoutTests/fast/eventsource/eventsource-constructor-expected.txt 2011-08-18 20:09:13 UTC (rev 93339)
+++ trunk/LayoutTests/fast/eventsource/eventsource-constructor-expected.txt 2011-08-18 20:11:24 UTC (rev 93340)
@@ -1,6 +1,6 @@
Test EventSource constructor functionality. Should print a series of PASS messages followed by DONE.
-PASS: missing argument to EventSource constructor resulted in an exception (SyntaxError: Not enough arguments)
+PASS: missing argument to EventSource constructor resulted in an exception (TypeError: Not enough arguments)
PASS: passing an empty string to the EventSource constructor resulted in an exception (Error: SYNTAX_ERR: DOM Exception 12)
PASS: passing an invalid URL to the EventSource constructor resulted in an exception (Error: SYNTAX_ERR: DOM Exception 12)
DONE
Modified: trunk/Source/WebCore/ChangeLog (93339 => 93340)
--- trunk/Source/WebCore/ChangeLog 2011-08-18 20:09:13 UTC (rev 93339)
+++ trunk/Source/WebCore/ChangeLog 2011-08-18 20:11:24 UTC (rev 93340)
@@ -1,5 +1,21 @@
2011-08-18 Kentaro Hara <[email protected]>
+ An EventSource constructor should throw TypeError, when the number of arguments is not enough.
+ https://bugs.webkit.org/show_bug.cgi?id=66454
+
+ Reviewed by Adam Barth.
+
+ The spec is here: http://www.w3.org/TR/WebIDL/#es-operations.
+
+ Test: fast/eventsource/eventsource-constructor.html
+
+ * bindings/js/JSEventSourceCustom.cpp:
+ (WebCore::JSEventSourceConstructor::constructJSEventSource): Changed SyntaxError to TypeError.
+ * bindings/v8/custom/V8EventSourceConstructor.cpp:
+ (WebCore::V8EventSource::constructorCallback): Changed SyntaxError to TypeError.
+
+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
Modified: trunk/Source/WebCore/bindings/js/JSEventSourceCustom.cpp (93339 => 93340)
--- trunk/Source/WebCore/bindings/js/JSEventSourceCustom.cpp 2011-08-18 20:09:13 UTC (rev 93339)
+++ trunk/Source/WebCore/bindings/js/JSEventSourceCustom.cpp 2011-08-18 20:11:24 UTC (rev 93340)
@@ -47,7 +47,7 @@
EncodedJSValue JSC_HOST_CALL JSEventSourceConstructor::constructJSEventSource(ExecState* exec)
{
if (exec->argumentCount() < 1)
- return throwVMError(exec, createSyntaxError(exec, "Not enough arguments"));
+ return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
UString url = ""
if (exec->hadException())
Modified: trunk/Source/WebCore/bindings/v8/custom/V8EventSourceConstructor.cpp (93339 => 93340)
--- trunk/Source/WebCore/bindings/v8/custom/V8EventSourceConstructor.cpp 2011-08-18 20:09:13 UTC (rev 93339)
+++ trunk/Source/WebCore/bindings/v8/custom/V8EventSourceConstructor.cpp 2011-08-18 20:11:24 UTC (rev 93340)
@@ -56,7 +56,7 @@
if (!context)
return throwError("EventSource constructor's associated context is not available", V8Proxy::ReferenceError);
if (args.Length() != 1)
- return throwError("Not enough arguments", V8Proxy::SyntaxError);
+ return throwError("Not enough arguments", V8Proxy::TypeError);
ExceptionCode ec = 0;
String url = ""
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes