Bug 1387678 - Allow Marionette sendAsync command to handle null or undefinedr?ato r=ato

When evaluating if an object can be null,  which would mean that we would
not be able to pass through IPC as, the commandId could not be added to null.
This patch makes sure that we can still send commands via IPC if the object is
evaluated to null.

MozReview-Commit-ID: Fl3Ionj08Sk

--HG--
extra : rebase_source : 33d015ac235ee74e903e13e234c55fda298f8e66
This commit is contained in:
David Burns 2018-05-03 11:00:26 +01:00
parent dd33e2c33f
commit 63b3aa0869

View File

@ -335,6 +335,10 @@ GeckoDriver.prototype.globalModalDialogHandler = function(subject, topic) {
GeckoDriver.prototype.sendAsync = function(name, data, commandID) {
let payload = evaluate.toJSON(data, this.seenEls);
if (payload === null) {
payload = {};
}
// TODO(ato): When proxy.AsyncMessageChannel
// is used for all chrome <-> content communication
// this can be removed.