Bug 1334728 - 1. Add missing argument to dispatch call in HelperApps.jsm; r=sebastian

Add the missing "type" argument to the EventDispatcher.instance.dispatch call.
This commit is contained in:
Jim Chen 2017-02-01 17:35:45 -05:00
parent 62e0b641a7
commit f45b77cea8

View File

@ -148,12 +148,15 @@ var HelperApps = {
};
if (!callback) {
let data = [];
let data = null;
// Use dispatch to enable synchronous callback for Gecko thread event.
EventDispatcher.instance.dispatch(msg, {
EventDispatcher.instance.dispatch(msg.type, msg, {
onSuccess: (result) => { data = result; },
onError: () => { throw new Error("Intent:GetHandler callback failed"); },
});
if (data === null) {
throw new Error("Intent:GetHandler did not return data");
}
return parseData(data);
} else {
EventDispatcher.instance.sendRequestForResult(msg).then(function(data) {