Bug 990057 - Fix Promise exception in simulator. r=jryans

This commit is contained in:
Alexandre Poirot 2014-04-10 10:01:58 -04:00
parent acb270f1b0
commit c5d51bce28
2 changed files with 6 additions and 6 deletions

View File

@ -6,7 +6,7 @@
const { Cc, Ci, Cu } = require("chrome");
const { SimulatorProcess } = require("./simulator-process");
const { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
const { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
const Self = require("sdk/self");
const System = require("sdk/system");
const { Simulator } = Cu.import("resource://gre/modules/devtools/Simulator.jsm");
@ -23,12 +23,12 @@ function launch({ port }) {
process.remoteDebuggerPort = port;
process.run();
return Promise.resolve();
return promise.resolve();
}
function close() {
if (!process) {
return Promise.resolve();
return promise.resolve();
}
let p = process;
process = null;

View File

@ -17,7 +17,7 @@ const Runtime = require("sdk/system/runtime");
const Self = require("sdk/self");
const URL = require("sdk/url");
const Subprocess = require("subprocess");
const { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
const { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
const { rootURI: ROOT_URI } = require('@loader/options');
const PROFILE_URL = ROOT_URI + "profile/";
@ -112,7 +112,7 @@ exports.SimulatorProcess = Class({
// request a b2g instance kill
kill: function() {
let deferred = Promise.defer();
let deferred = promise.defer();
if (this.process) {
this.once("exit", (exitCode) => {
this.shuttingDown = false;
@ -125,7 +125,7 @@ exports.SimulatorProcess = Class({
}
return deferred.promise;
} else {
return Promise.resolve(undefined);
return promise.resolve(undefined);
}
},