Title: [101904] trunk
Revision
101904
Author
dslo...@google.com
Date
2011-12-02 21:40:46 -0800 (Fri, 02 Dec 2011)

Log Message

https://bugs.webkit.org/show_bug.cgi?id=73691
[JSC] Implement correct order of window.postMessage arguments.

Reviewed by Geoffrey Garen.

Source/WebCore:

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::handlePostMessage):

LayoutTests:

* fast/dom/Window/window-postmessage-args-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (101903 => 101904)


--- trunk/LayoutTests/ChangeLog	2011-12-03 05:34:42 UTC (rev 101903)
+++ trunk/LayoutTests/ChangeLog	2011-12-03 05:40:46 UTC (rev 101904)
@@ -1,3 +1,12 @@
+2011-12-02  Dmitry Lomov  <dslo...@google.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=73691
+        [JSC] Implement correct order of window.postMessage arguments.
+
+        Reviewed by Geoffrey Garen.
+
+        * fast/dom/Window/window-postmessage-args-expected.txt:
+
 2011-12-02  Stephen Chenney  <schen...@chromium.org>
 
         REGRESSION (r91125): Polyline tool in google docs is broken

Modified: trunk/LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt (101903 => 101904)


--- trunk/LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt	2011-12-03 05:34:42 UTC (rev 101903)
+++ trunk/LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt	2011-12-03 05:40:46 UTC (rev 101904)
@@ -6,28 +6,35 @@
 PASS: Posting message ('2', c): threw exception TypeError: Type error
 PASS: Posting message ('3', [object Object]): threw exception TypeError: Type error
 PASS: Posting message ('3', [object Object]): threw exception TypeError: Type error
-FAIL: Posting message ('4', [object DOMWindow]): threw exception TypeError: Type error
-FAIL: Posting message ('4', [object DOMWindow]): threw exception TypeError: Type error
+PASS: Posting message ('4', [object DOMWindow]) did not throw an exception
+PASS: Posting message ('4', [object DOMWindow]) did not throw an exception
 PASS: Posting message ('5', null) did not throw an exception
 PASS: Posting message ('5', null) did not throw an exception
 PASS: Posting message ('6', undefined) did not throw an exception
 PASS: Posting message ('6', undefined) did not throw an exception
-FAIL: Posting message ('7', [object MessagePort],[object MessagePort]): threw exception TypeError: Type error
-FAIL: Posting message ('7', [object MessagePort],[object MessagePort]): threw exception TypeError: Type error
+PASS: Posting message ('7', [object MessagePort],[object MessagePort]) did not throw an exception
+PASS: Posting message ('7', [object MessagePort],[object MessagePort]) did not throw an exception
 PASS: Posting message ('2147483648', null) did not throw an exception
 PASS: Posting message ('2147483648', null) did not throw an exception
-FAIL: Posting message ('[object MessagePort]', [object MessagePort],[object MessagePort]): threw exception TypeError: Type error
-FAIL: Posting message ('[object MessagePort]', [object MessagePort],[object MessagePort]): threw exception TypeError: Type error
-FAIL: Posting message ('[object MessagePort],[object MessagePort]', [object MessagePort],[object MessagePort]): threw exception TypeError: Type error
+PASS: Posting message ('[object MessagePort]', [object MessagePort],[object MessagePort]) did not throw an exception
+PASS: Posting message ('[object MessagePort]', [object MessagePort],[object MessagePort]) did not throw an exception
+PASS: Posting message ('[object MessagePort],[object MessagePort]', [object MessagePort],[object MessagePort]) did not throw an exception
 FAIL: Posting message ('[object ArrayBuffer]', [object ArrayBuffer]): threw exception TypeError: Type error
 FAIL: arrayBuffer not neutered; byteLength = 30
 FAIL: view was not neutered; length = 10
 PASS: Posting message ('done', undefined) did not throw an exception
+Received message '4' with 0 ports.
+Received message '4' with 0 ports.
 Received message '5' with 0 ports.
 Received message '5' with 0 ports.
 Received message '6' with 0 ports.
 Received message '6' with 0 ports.
+Received message '7' with 2 ports.
+Received message '7' with 2 ports.
 Received message '2147483648' with 0 ports.
 Received message '2147483648' with 0 ports.
+Received message '[object Object]' with 2 ports.
+Received message '[object MessagePort]' with 2 ports.
+Received message '[object MessagePort],[object MessagePort]' with 2 ports.
 Received message 'done' with 0 ports.
 

Modified: trunk/Source/WebCore/ChangeLog (101903 => 101904)


--- trunk/Source/WebCore/ChangeLog	2011-12-03 05:34:42 UTC (rev 101903)
+++ trunk/Source/WebCore/ChangeLog	2011-12-03 05:40:46 UTC (rev 101904)
@@ -1,3 +1,13 @@
+2011-12-02  Dmitry Lomov  <dslo...@google.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=73691
+        [JSC] Implement correct order of window.postMessage arguments.
+
+        Reviewed by Geoffrey Garen.
+
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::handlePostMessage):
+
 2011-12-02  Stephen Chenney  <schen...@chromium.org>
 
         REGRESSION (r91125): Polyline tool in google docs is broken

Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (101903 => 101904)


--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp	2011-12-03 05:34:42 UTC (rev 101903)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp	2011-12-03 05:40:46 UTC (rev 101904)
@@ -706,7 +706,7 @@
 {
     MessagePortArray messagePorts;
     if (exec->argumentCount() > 2)
-        fillMessagePortArray(exec, exec->argument(1), messagePorts);
+        fillMessagePortArray(exec, exec->argument(2), messagePorts);
     if (exec->hadException())
         return jsUndefined();
 
@@ -716,7 +716,7 @@
     if (exec->hadException())
         return jsUndefined();
 
-    String targetOrigin = valueToStringWithUndefinedOrNullCheck(exec, exec->argument((exec->argumentCount() == 2) ? 1 : 2));
+    String targetOrigin = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(1));
     if (exec->hadException())
         return jsUndefined();
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to