Title: [198906] trunk/Source/WebKit2
Revision
198906
Author
[email protected]
Date
2016-03-31 11:56:10 -0700 (Thu, 31 Mar 2016)

Log Message

Web Automation: Handle undefined when calling a function that has no result

https://bugs.webkit.org/show_bug.cgi?id=156075
rdar://problem/25468907

Reviewed by Brian Burg.

* WebProcess/Automation/WebAutomationSessionProxy.js:
(let.AutomationSessionProxy.prototype._jsonParse): Return undefined for empty string.
(let.AutomationSessionProxy.prototype._jsonStringify): Always return a string.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (198905 => 198906)


--- trunk/Source/WebKit2/ChangeLog	2016-03-31 18:54:36 UTC (rev 198905)
+++ trunk/Source/WebKit2/ChangeLog	2016-03-31 18:56:10 UTC (rev 198906)
@@ -1,3 +1,16 @@
+2016-03-31  Timothy Hatcher  <[email protected]>
+
+        Web Automation: Handle undefined when calling a function that has no result
+
+        https://bugs.webkit.org/show_bug.cgi?id=156075
+        rdar://problem/25468907
+
+        Reviewed by Brian Burg.
+
+        * WebProcess/Automation/WebAutomationSessionProxy.js:
+        (let.AutomationSessionProxy.prototype._jsonParse): Return undefined for empty string.
+        (let.AutomationSessionProxy.prototype._jsonStringify): Always return a string.
+
 2016-03-31  Jeremy Jones  <[email protected]>
 
         mediaShouldUsePersistentCache() is redundant. Use Page::usesEphemeralSession() instead.

Modified: trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.js (198905 => 198906)


--- trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.js	2016-03-31 18:54:36 UTC (rev 198905)
+++ trunk/Source/WebKit2/WebProcess/Automation/WebAutomationSessionProxy.js	2016-03-31 18:56:10 UTC (rev 198906)
@@ -69,12 +69,14 @@
 
     _jsonParse(string)
     {
+        if (!string)
+            return undefined;
         return JSON.parse(string, (key, value) => this._reviveJSONValue(key, value));
     }
 
     _jsonStringify(original)
     {
-        return JSON.stringify(original, (key, value) => this._replaceJSONValue(key, value));
+        return JSON.stringify(original, (key, value) => this._replaceJSONValue(key, value)) || "";
     }
 
     _reviveJSONValue(key, value)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to