Rename Promise to promise to avoid collisions with the forthcoming DOM Promise implementation (bug 885318); r=jwalker
authorPanos Astithas <past@mozilla.com>
Thu, 11 Jul 2013 10:12:20 +0300
changeset 138171 d5a0afa466c2eba626e48f5d87cfcd1744bf338d
parent 138105 9f58c0b28e37b12c47a432cf6a941f5a014a34f5
child 138172 85f89c4893597c7b22b0b7264496c292961a773a
push id30845
push userryanvm@gmail.com
push dateThu, 11 Jul 2013 14:59:18 +0000
treeherdermozilla-inbound@f20a94209ab7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalker
bugs885318
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Rename Promise to promise to avoid collisions with the forthcoming DOM Promise implementation (bug 885318); r=jwalker
browser/devtools/commandline/BuiltinCommands.jsm
browser/devtools/commandline/test/browser_cmd_addon.js
browser/devtools/commandline/test/browser_cmd_appcache_invalid.js
browser/devtools/commandline/test/browser_cmd_appcache_valid.js
browser/devtools/commandline/test/browser_cmd_calllog.js
browser/devtools/commandline/test/browser_cmd_calllog_chrome.js
browser/devtools/commandline/test/browser_cmd_commands.js
browser/devtools/commandline/test/browser_cmd_jsb.js
browser/devtools/commandline/test/browser_cmd_pagemod_export.js
browser/devtools/commandline/test/browser_cmd_screenshot.js
browser/devtools/commandline/test/browser_gcli_async.js
browser/devtools/commandline/test/helpers.js
browser/devtools/debugger/DebuggerPanel.jsm
browser/devtools/debugger/debugger-controller.js
browser/devtools/debugger/test/browser_dbg_bug883220_raise_on_pause.js
browser/devtools/debugger/test/browser_dbg_cmd.js
browser/devtools/debugger/test/browser_dbg_cmd_break.js
browser/devtools/framework/gDevTools.jsm
browser/devtools/framework/sidebar.js
browser/devtools/framework/target.js
browser/devtools/framework/test/browser_devtools_api.js
browser/devtools/framework/test/browser_toolbox_options_disablejs.js
browser/devtools/framework/test/browser_toolbox_sidebar.js
browser/devtools/framework/test/browser_toolbox_window_title_changes.js
browser/devtools/framework/test/head.js
browser/devtools/framework/toolbox-hosts.js
browser/devtools/framework/toolbox-options.js
browser/devtools/framework/toolbox.js
browser/devtools/inspector/inspector-panel.js
browser/devtools/inspector/test/browser_inspector_bug_840156_destroy_after_navigation.js
browser/devtools/netmonitor/NetMonitorPanel.jsm
browser/devtools/netmonitor/netmonitor-controller.js
browser/devtools/netmonitor/netmonitor-view.js
browser/devtools/netmonitor/test/browser_net_content-type.js
browser/devtools/netmonitor/test/browser_net_filter-01.js
browser/devtools/netmonitor/test/browser_net_filter-02.js
browser/devtools/netmonitor/test/browser_net_filter-03.js
browser/devtools/netmonitor/test/browser_net_post-data-01.js
browser/devtools/netmonitor/test/browser_net_sort-01.js
browser/devtools/netmonitor/test/browser_net_sort-02.js
browser/devtools/netmonitor/test/browser_net_sort-03.js
browser/devtools/netmonitor/test/head.js
browser/devtools/profiler/commands.js
browser/devtools/profiler/panel.js
browser/devtools/profiler/test/browser_profiler_bug_855244_multiple_tabs.js
browser/devtools/profiler/test/browser_profiler_cmd.js
browser/devtools/profiler/test/browser_profiler_gecko_data.js
browser/devtools/profiler/test/browser_profiler_run.js
browser/devtools/scratchpad/scratchpad.js
browser/devtools/scratchpad/test/head.js
browser/devtools/shared/AppCacheUtils.jsm
browser/devtools/shared/test/browser_telemetry_buttonsandsidebar.js
browser/devtools/shared/test/browser_telemetry_toolboxtabs_inspector.js
browser/devtools/shared/test/browser_telemetry_toolboxtabs_jsdebugger.js
browser/devtools/shared/test/browser_telemetry_toolboxtabs_jsprofiler.js
browser/devtools/shared/test/browser_telemetry_toolboxtabs_netmonitor.js
browser/devtools/shared/test/browser_telemetry_toolboxtabs_options.js
browser/devtools/shared/test/browser_telemetry_toolboxtabs_styleeditor.js
browser/devtools/shared/test/browser_telemetry_toolboxtabs_webconsole.js
browser/devtools/shared/test/browser_templater_basic.js
browser/devtools/shared/widgets/VariablesView.jsm
browser/devtools/shared/widgets/VariablesViewController.jsm
browser/devtools/styleeditor/StyleEditorDebuggee.jsm
browser/devtools/styleeditor/StyleEditorPanel.jsm
browser/devtools/styleeditor/StyleEditorUI.jsm
browser/devtools/styleeditor/StyleSheetEditor.jsm
browser/devtools/styleeditor/test/browser_styleeditor_cmd_edit.js
browser/devtools/webconsole/HUDService.jsm
browser/devtools/webconsole/WebConsolePanel.jsm
browser/devtools/webconsole/test/head.js
browser/devtools/webconsole/webconsole.js
toolkit/devtools/Loader.jsm
toolkit/devtools/client/dbg-client.jsm
toolkit/devtools/gcli/gcli.jsm
toolkit/devtools/server/actors/webapps.js
toolkit/devtools/server/main.js
toolkit/devtools/server/tests/mochitest/inspector-helpers.js
toolkit/devtools/server/tests/mochitest/test_inspector-changeattrs.html
toolkit/devtools/server/tests/mochitest/test_inspector-changevalue.html
toolkit/devtools/server/tests/mochitest/test_inspector-mutations-attr.html
toolkit/devtools/server/tests/mochitest/test_inspector-mutations-childlist.html
toolkit/devtools/server/tests/mochitest/test_inspector-mutations-frameload.html
toolkit/devtools/server/tests/mochitest/test_inspector-mutations-value.html
toolkit/devtools/server/tests/mochitest/test_inspector-pseudoclass-lock.html
toolkit/devtools/server/tests/mochitest/test_inspector-release.html
toolkit/devtools/server/tests/mochitest/test_inspector-retain.html
toolkit/devtools/server/tests/mochitest/test_inspector-traversal.html
--- a/browser/devtools/commandline/BuiltinCommands.jsm
+++ b/browser/devtools/commandline/BuiltinCommands.jsm
@@ -8,17 +8,17 @@ const BRAND_SHORT_NAME = Cc["@mozilla.or
                            .getService(Ci.nsIStringBundleService)
                            .createBundle("chrome://branding/locale/brand.properties")
                            .GetStringFromName("brandShortName");
 
 this.EXPORTED_SYMBOLS = [ "CmdAddonFlags", "CmdCommands", "DEFAULT_DEBUG_PORT", "connect" ];
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
+let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js").Promise;
 Cu.import("resource://gre/modules/osfile.jsm");
 
 Cu.import("resource://gre/modules/devtools/gcli.jsm");
 Cu.import("resource:///modules/devtools/shared/event-emitter.js");
 
 var require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
 let Telemetry = require("devtools/shared/telemetry");
 let telemetry = new Telemetry();
@@ -641,35 +641,35 @@ XPCOMUtils.defineLazyModuleGetter(this, 
         let dirService = Cc["@mozilla.org/file/directory_service;1"]
                           .getService(Ci.nsIProperties);
         let homeDirFile = dirService.get("Home", Ci.nsIFile);
         let homeDir = homeDirFile.path;
         dirName = dirName.substr(1);
         dirName = homeDir + dirName;
       }
 
-      let promise = OS.File.stat(dirName);
-      promise = promise.then(
+      let statPromise = OS.File.stat(dirName);
+      statPromise = statPromise.then(
         function onSuccess(stat) {
           if (!stat.isDir) {
             throw new Error('\'' + dirName + '\' is not a directory.');
           } else {
             return dirName;
           }
         },
         function onFailure(reason) {
           if (reason instanceof OS.File.Error && reason.becauseNoSuchFile) {
             throw new Error('\'' + dirName + '\' does not exist.');
           } else {
             throw reason;
           }
         }
       );
 
-      promise.then(
+      statPromise.then(
         function onSuccess() {
           let iterator = new OS.File.DirectoryIterator(dirName);
           let iterPromise = iterator.forEach(
             function onEntry(entry) {
               if (entry.name.match(/.*\.mozcmd$/) && !entry.isDir) {
                 loadCommandFile(entry, aSandboxPrincipal);
               }
             }
@@ -692,18 +692,18 @@ XPCOMUtils.defineLazyModuleGetter(this, 
   /**
    * Load the commands from a single file
    * @param OS.File.DirectoryIterator.Entry aFileEntry The DirectoryIterator
    * Entry of the file containing the commands that we should read
    * @param nsIPrincipal aSandboxPrincipal Scope object for the Sandbox in which
    * we eval the script from the .mozcmd file. This should be a chrome window.
    */
   function loadCommandFile(aFileEntry, aSandboxPrincipal) {
-    let promise = OS.File.read(aFileEntry.path);
-    promise = promise.then(
+    let readPromise = OS.File.read(aFileEntry.path);
+    readPromise = readPromise.then(
       function onSuccess(array) {
         let decoder = new TextDecoder();
         let source = decoder.decode(array);
 
         let sandbox = new Cu.Sandbox(aSandboxPrincipal, {
           sandboxPrototype: aSandboxPrincipal,
           wantXrays: false,
           sandboxName: aFileEntry.path
--- a/browser/devtools/commandline/test/browser_cmd_addon.js
+++ b/browser/devtools/commandline/test/browser_cmd_addon.js
@@ -9,17 +9,17 @@ let tests = {};
 
 function test() {
   helpers.addTabWithToolbar("about:blank", function(options) {
     return helpers.runTests(options, tests);
   }).then(finish);
 }
 
 tests.gatTest = function(options) {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   let onGatReady = function() {
     Services.obs.removeObserver(onGatReady, "gcli_addon_commands_ready");
     info("gcli_addon_commands_ready notification received, running tests");
 
     let auditDone = helpers.audit(options, [
       {
         setup: 'addon list dictionary',
--- a/browser/devtools/commandline/test/browser_cmd_appcache_invalid.js
+++ b/browser/devtools/commandline/test/browser_cmd_appcache_invalid.js
@@ -6,17 +6,17 @@
 
 const TEST_URI = "http://sub1.test1.example.com/browser/browser/devtools/commandline/" +
                  "test/browser_cmd_appcache_invalid_index.html";
 
 let tests = {};
 
 function test() {
   helpers.addTabWithToolbar(TEST_URI, function(options) {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     // Wait for site to be cached.
     gBrowser.contentWindow.applicationCache.addEventListener('error', function BCAI_error() {
       gBrowser.contentWindow.applicationCache.removeEventListener('error', BCAI_error);
 
       info("Site now cached, running tests.");
 
       deferred.resolve(helpers.audit(options, [
--- a/browser/devtools/commandline/test/browser_cmd_appcache_valid.js
+++ b/browser/devtools/commandline/test/browser_cmd_appcache_valid.js
@@ -4,17 +4,17 @@
 // Tests that the appcache commands works as they should
 
 const TEST_URI = "http://sub1.test2.example.com/browser/browser/devtools/" +
                  "commandline/test/browser_cmd_appcache_valid_index.html";
 let tests = {};
 
 function test() {
   helpers.addTabWithToolbar(TEST_URI, function(options) {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     info("adding cache listener.");
 
     // Wait for site to be cached.
     gBrowser.contentWindow.applicationCache.addEventListener('cached', function BCAV_cached() {
       gBrowser.contentWindow.applicationCache.removeEventListener('cached', BCAV_cached);
 
       info("Site now cached, running tests.");
--- a/browser/devtools/commandline/test/browser_cmd_calllog.js
+++ b/browser/devtools/commandline/test/browser_cmd_calllog.js
@@ -43,17 +43,17 @@ tests.testCallLogStatus = function(optio
         markup: 'VVVVVVVVVVVV',
         status: 'VALID'
       }
     },
   ]);
 };
 
 tests.testCallLogExec = function(options) {
-  var deferred = Promise.defer();
+  var deferred = promise.defer();
 
   var onWebConsoleOpen = function(subject) {
     Services.obs.removeObserver(onWebConsoleOpen, "web-console-created");
 
     subject.QueryInterface(Ci.nsISupportsString);
     let hud = HUDService.getHudReferenceById(subject.data);
     ok(hud.hudId in HUDService.hudReferences, "console open");
 
@@ -92,17 +92,17 @@ tests.testCallLogExec = function(options
       exec: {
         output: /No call logging/,
       }
     },
     {
       name: "calllog start",
       setup: function() {
         // This test wants to be in a different event
-        var deferred = Promise.defer();
+        var deferred = promise.defer();
         executeSoon(function() {
           helpers.setInput(options, "calllog start");
           deferred.resolve();
         });
         return deferred.promise;
       },
       exec: {
         output: /Call logging started/,
--- a/browser/devtools/commandline/test/browser_cmd_calllog_chrome.js
+++ b/browser/devtools/commandline/test/browser_cmd_calllog_chrome.js
@@ -44,17 +44,17 @@ tests.testCallLogStatus = function(optio
         status: "VALID",
         emptyParameters: [ " " ]
       }
     },
   ]);
 };
 
 tests.testCallLogExec = function(options) {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   function onWebConsoleOpen(subject) {
     Services.obs.removeObserver(onWebConsoleOpen, "web-console-created");
 
     subject.QueryInterface(Ci.nsISupportsString);
     let hud = HUDService.getHudReferenceById(subject.data);
     ok(hud.hudId in HUDService.hudReferences, "console open");
 
--- a/browser/devtools/commandline/test/browser_cmd_commands.js
+++ b/browser/devtools/commandline/test/browser_cmd_commands.js
@@ -11,17 +11,17 @@ let tests = {};
 
 function test() {
   helpers.addTabWithToolbar(TEST_URI, function(options) {
     return helpers.runTests(options, tests);
   }).then(finish);
 }
 
 tests.testConsole = function(options) {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
   let hud = null;
 
   let onWebConsoleOpen = function(subject) {
     Services.obs.removeObserver(onWebConsoleOpen, "web-console-created");
 
     subject.QueryInterface(Ci.nsISupportsString);
     hud = HUDService.getHudReferenceById(subject.data);
     ok(hud.hudId in HUDService.hudReferences, "console open");
--- a/browser/devtools/commandline/test/browser_cmd_jsb.js
+++ b/browser/devtools/commandline/test/browser_cmd_jsb.js
@@ -12,17 +12,17 @@ let tests = {};
 
 function test() {
   helpers.addTabWithToolbar("about:blank", function(options) {
     return helpers.runTests(options, tests);
   }).then(finish);
 }
 
 tests.jsbTest = function(options) {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   let observer = {
     onReady: function() {
       scratchpad.removeObserver(observer);
 
       let result = scratchpad.getText();
       result = result.replace(/[\r\n]]*/g, "\n");
       let correct = "function somefunc() {\n" +
--- a/browser/devtools/commandline/test/browser_cmd_pagemod_export.js
+++ b/browser/devtools/commandline/test/browser_cmd_pagemod_export.js
@@ -304,17 +304,17 @@ function test() {
           args: {
             searchAttributes: { value: 'foo' },
             searchElements: { value: 'bar' },
             root: { value: undefined },
             ignoreCase: { value: false },
           }
         },
         post: function() {
-          let deferred = Promise.defer();
+          let deferred = promise.defer();
           executeSoon(function() {
             deferred.resolve();
           });
           return deferred.promise;
         }
       },
       {
         setup: 'pagemod remove attribute foo bar',
--- a/browser/devtools/commandline/test/browser_cmd_screenshot.js
+++ b/browser/devtools/commandline/test/browser_cmd_screenshot.js
@@ -161,29 +161,29 @@ function test() {
 function addTabWithToolbarRunTests(win) {
   return helpers.addTabWithToolbar(TEST_URI, function(options) {
     return helpers.runTests(options, tests);
   }, { chromeWindow: win });
 }
 
 function addWindow(windowOptions, callback) {
   waitForExplicitFinish();
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   let win = OpenBrowserWindow(windowOptions);
 
   let onLoad = function() {
     win.removeEventListener("load", onLoad, false);
 
     // Would like to get rid of this executeSoon, but without it the url
     // (TEST_URI) provided in addTabWithToolbarRunTests hasn't loaded
     executeSoon(function() {
       try {
         let reply = callback(win);
-        Promise.resolve(reply).then(function() {
+        promise.resolve(reply).then(function() {
           win.close();
           deferred.resolve();
         });
       }
       catch (ex) {
         deferred.reject(ex);
       }
     });
--- a/browser/devtools/commandline/test/browser_gcli_async.js
+++ b/browser/devtools/commandline/test/browser_gcli_async.js
@@ -22,21 +22,21 @@ function test() {
 }
 
 // <INJECTED SOURCE:END>
 
 'use strict';
 
 // var helpers = require('gclitest/helpers');
 var canon = require('gcli/canon');
-var Promise = require('util/promise');
+var promise = require('util/promise');
 
 exports.testBasic = function(options) {
   var getData = function() {
-    var deferred = Promise.defer();
+    var deferred = promise.defer();
 
     var resolve = function() {
       deferred.resolve([
         'Shalom', 'Namasté', 'Hallo', 'Dydd-da',
         'Chào', 'Hej', 'Saluton', 'Sawubona'
       ]);
     };
 
--- a/browser/devtools/commandline/test/helpers.js
+++ b/browser/devtools/commandline/test/helpers.js
@@ -21,17 +21,17 @@ this.EXPORTED_SYMBOLS = [ 'helpers' ];
 var helpers = {};
 this.helpers = helpers;
 let require = (Cu.import("resource://gre/modules/devtools/Require.jsm", {})).require;
 Components.utils.import("resource://gre/modules/devtools/gcli.jsm", {});
 
 let console = (Cu.import("resource://gre/modules/devtools/Console.jsm", {})).console;
 let TargetFactory = (Cu.import("resource://gre/modules/devtools/Loader.jsm", {})).devtools.TargetFactory;
 
-let Promise = (Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {})).Promise;
+let promise = (Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {})).Promise;
 let assert = { ok: ok, is: is, log: info };
 
 var util = require('util/util');
 
 var converters = require('gcli/converters');
 
 /**
  * Warning: For use with Firefox Mochitests only.
@@ -55,17 +55,17 @@ var converters = require('gcli/converter
  * 'options' parameter. This has the ability to customize the value of
  * chromeWindow or isFirefox, and to add new properties.
  *
  * @param url The URL for the new tab
  * @param callback The function to call on page load
  * @param options An optional set of options to customize the way the tests run
  */
 helpers.addTab = function(url, callback, options) {
-  var deferred = Promise.defer();
+  var deferred = promise.defer();
 
   waitForExplicitFinish();
 
   options = options || {};
   options.chromeWindow = options.chromeWindow || window;
   options.isFirefox = true;
 
   var tabbrowser = options.chromeWindow.gBrowser;
@@ -91,17 +91,17 @@ helpers.addTab = function(url, callback,
 
       delete options.chromeWindow;
       delete options.isFirefox;
 
       deferred.resolve();
     };
 
     var reply = callback(options);
-    Promise.resolve(reply).then(cleanUp, function(error) {
+    promise.resolve(reply).then(cleanUp, function(error) {
       ok(false, error);
       cleanUp();
     });
   };
 
   options.browser.contentWindow.location = url;
   options.browser.addEventListener("load", onPageLoad, true);
 
@@ -113,29 +113,29 @@ helpers.addTab = function(url, callback,
  *
  * As addTab, but that also opens the developer toolbar. In addition a new
  * 'display' property is added to the options object with the display from GCLI
  * in the developer toolbar
  */
 helpers.addTabWithToolbar = function(url, callback, options) {
   return helpers.addTab(url, function(innerOptions) {
     var win = innerOptions.chromeWindow;
-    var deferred = Promise.defer();
+    var deferred = promise.defer();
 
     win.DeveloperToolbar.show(true, function() {
       innerOptions.display = win.DeveloperToolbar.display;
 
       var cleanUp = function() {
         win.DeveloperToolbar.hide();
         delete innerOptions.display;
         deferred.resolve();
       };
 
       var reply = callback(innerOptions);
-      Promise.resolve(reply).then(cleanUp, function(error) {
+      promise.resolve(reply).then(cleanUp, function(error) {
         ok(false, error);
         cleanUp();
       });
     });
     return deferred.promise;
   }, options);
 };
 
@@ -158,42 +158,42 @@ helpers.runTests = function(options, tes
 
   var recover = function(error) {
     ok(false, error);
     console.error(error);
   };
 
   info("SETUP");
   var setupDone = (tests.setup != null) ?
-      Promise.resolve(tests.setup(options)) :
-      Promise.resolve();
+      promise.resolve(tests.setup(options)) :
+      promise.resolve();
 
   var testDone = setupDone.then(function() {
     return util.promiseEach(testNames, function(testName) {
       info(testName);
       var action = tests[testName];
 
       if (typeof action === "function") {
         var reply = action.call(tests, options);
-        return Promise.resolve(reply);
+        return promise.resolve(reply);
       }
       else if (Array.isArray(action)) {
         return helpers.audit(options, action);
       }
 
-      return Promise.reject("test action '" + testName +
+      return promise.reject("test action '" + testName +
                             "' is not a function or helpers.audit() object");
     });
   }, recover);
 
   return testDone.then(function() {
     info("SHUTDOWN");
     return (tests.shutdown != null) ?
-        Promise.resolve(tests.shutdown(options)) :
-        Promise.resolve();
+        promise.resolve(tests.shutdown(options)) :
+        promise.resolve();
   }, recover);
 };
 
 ///////////////////////////////////////////////////////////////////////////////
 
 function checkOptions(options) {
   if (options == null) {
     console.trace();
@@ -221,17 +221,17 @@ helpers._actual = {
     var templateData = options.display.completer._getCompleterTemplateData();
     var join = function(directTabText, emptyParameters, arrowTabText) {
       return (directTabText + emptyParameters.join('') + arrowTabText)
                 .replace(/\u00a0/g, ' ')
                 .replace(/\u21E5/, '->')
                 .replace(/ $/, '');
     };
 
-    var promisedJoin = Promise.promised(join);
+    var promisedJoin = promise.promised(join);
     return promisedJoin(templateData.directTabText,
                         templateData.emptyParameters,
                         templateData.arrowTabText);
   },
 
   markup: function(options) {
     var cursor = options.display.inputter.element.selectionStart;
     var statusMarkup = options.display.requisition.getInputStatusMarkup(cursor);
@@ -309,17 +309,17 @@ helpers._createDebugCheck = function(opt
   var command = requisition.commandAssignment.value;
   var cursor = helpers._actual.cursor(options);
   var input = helpers._actual.input(options);
   var padding = Array(input.length + 1).join(' ');
 
   var hintsPromise = helpers._actual.hints(options);
   var predictionsPromise = helpers._actual.predictions(options);
 
-  return Promise.all(hintsPromise, predictionsPromise).then(function(values) {
+  return promise.all(hintsPromise, predictionsPromise).then(function(values) {
     var hints = values[0];
     var predictions = values[1];
     var output = '';
 
     output += 'return helpers.audit(options, [\n';
     output += '  {\n';
 
     if (cursor === input.length) {
@@ -454,53 +454,53 @@ var CHUNKER = /([^<]*)(<[A-Z]+>)/;
 
 /**
  * Alter the input to <code>typed</code> optionally leaving the cursor at
  * <code>cursor</code>.
  * @return A promise of the number of key-presses to respond
  */
 helpers.setInput = function(options, typed, cursor) {
   checkOptions(options);
-  var promise = undefined;
+  var inputPromise = undefined;
   var inputter = options.display.inputter;
   // We try to measure average keypress time, but setInput can simulate
   // several, so we try to keep track of how many
   var chunkLen = 1;
 
   // The easy case is a simple string without things like <TAB>
   if (typed.indexOf('<') === -1) {
-    promise = inputter.setInput(typed);
+    inputPromise = inputter.setInput(typed);
   }
   else {
     // Cut the input up into input strings separated by '<KEY>' tokens. The
     // CHUNKS RegExp leaves blanks so we filter them out.
     var chunks = typed.split(CHUNKER).filter(function(s) {
       return s != '';
     });
     chunkLen = chunks.length + 1;
 
     // We're working on this in chunks so first clear the input
-    promise = inputter.setInput('').then(function() {
+    inputPromise = inputter.setInput('').then(function() {
       return util.promiseEach(chunks, function(chunk) {
         if (chunk.charAt(0) === '<') {
           var action = ACTIONS[chunk];
           if (typeof action !== 'function') {
             console.error('Known actions: ' + Object.keys(ACTIONS).join());
             throw new Error('Key action not found "' + chunk + '"');
           }
           return action(options);
         }
         else {
           return inputter.setInput(inputter.element.value + chunk);
         }
       });
     });
   }
 
-  return promise.then(function() {
+  return inputPromise.then(function() {
     if (cursor != null) {
       options.display.inputter.setCursor({ start: cursor, end: cursor });
     }
     else {
       // This is a hack because jsdom appears to not handle cursor updates
       // in the same way as most browsers.
       if (options.isJsdom) {
         options.display.inputter.setCursor({
@@ -526,17 +526,17 @@ helpers.setInput = function(options, typ
  * Helper for helpers.audit() to ensure that all the 'check' properties match.
  * See helpers.audit for more information.
  * @param name The name to use in error messages
  * @param checks See helpers.audit for a list of available checks
  * @return A promise which resolves to undefined when the checks are complete
  */
 helpers._check = function(options, name, checks) {
   if (checks == null) {
-    return Promise.resolve();
+    return promise.resolve();
   }
 
   var outstanding = [];
   var suffix = name ? ' (for \'' + name + '\')' : '';
 
   if ('input' in checks) {
     assert.is(helpers._actual.input(options), checks.input, 'input' + suffix);
   }
@@ -695,58 +695,58 @@ helpers._check = function(options, name,
           assert.is(assignment.getMessage(),
                     check.message,
                     'arg.' + paramName + '.message' + suffix);
         }
       }
     });
   }
 
-  return Promise.all(outstanding).then(function() {
+  return promise.all(outstanding).then(function() {
     // Ensure the promise resolves to nothing
     return undefined;
   });
 };
 
 /**
  * Helper for helpers.audit() to ensure that all the 'exec' properties work.
  * See helpers.audit for more information.
  * @param name The name to use in error messages
  * @param expected See helpers.audit for a list of available exec checks
  * @return A promise which resolves to undefined when the checks are complete
  */
 helpers._exec = function(options, name, expected) {
   if (expected == null) {
-    return Promise.resolve({});
+    return promise.resolve({});
   }
 
   var output;
   try {
     output = options.display.requisition.exec({ hidden: true });
   }
   catch (ex) {
     assert.ok(false, 'Failure executing \'' + name + '\': ' + ex);
     util.errorHandler(ex);
 
-    return Promise.resolve({});
+    return promise.resolve({});
   }
 
   if ('completed' in expected) {
     assert.is(output.completed,
               expected.completed,
               'output.completed false for: ' + name);
   }
 
   if (!options.window.document.createElement) {
     assert.log('skipping output tests (missing doc.createElement) for ' + name);
-    return Promise.resolve({ output: output });
+    return promise.resolve({ output: output });
   }
 
   if (!('output' in expected)) {
-    return Promise.resolve({ output: output });
+    return promise.resolve({ output: output });
   }
 
   var checkOutput = function() {
     if ('type' in expected) {
       assert.is(output.type,
                 expected.type,
                 'output.type for: ' + name);
     }
@@ -799,30 +799,30 @@ helpers._exec = function(options, name, 
  * Helper to setup the test
  */
 helpers._setup = function(options, name, action) {
   if (typeof action === 'string') {
     return helpers.setInput(options, action);
   }
 
   if (typeof action === 'function') {
-    return Promise.resolve(action());
+    return promise.resolve(action());
   }
 
-  return Promise.reject('\'setup\' property must be a string or a function. Is ' + action);
+  return promise.reject('\'setup\' property must be a string or a function. Is ' + action);
 };
 
 /**
  * Helper to shutdown the test
  */
 helpers._post = function(name, action, data) {
   if (typeof action === 'function') {
-    return Promise.resolve(action(data.output, data.text));
+    return promise.resolve(action(data.output, data.text));
   }
-  return Promise.resolve(action);
+  return promise.resolve(action);
 };
 
 /*
  * We do some basic response time stats so we can see if we're getting slow
  */
 var totalResponseTime = 0;
 var averageOver = 0;
 var maxResponseTime = 0;
@@ -942,36 +942,36 @@ helpers.audit = function(options, audits
 
     if (audit.skipIf) {
       var skip = (typeof audit.skipIf === 'function') ?
           audit.skipIf(options) :
           !!audit.skipIf;
       if (skip) {
         var reason = audit.skipIf.name ? 'due to ' + audit.skipIf.name : '';
         assert.log('Skipped ' + name + ' ' + reason);
-        return Promise.resolve(undefined);
+        return promise.resolve(undefined);
       }
     }
 
     if (audit.skipRemainingIf) {
       var skipRemainingIf = (typeof audit.skipRemainingIf === 'function') ?
           audit.skipRemainingIf(options) :
           !!audit.skipRemainingIf;
       if (skipRemainingIf) {
         skipReason = audit.skipRemainingIf.name ?
             'due to ' + audit.skipRemainingIf.name :
             '';
         assert.log('Skipped ' + name + ' ' + skipReason);
-        return Promise.resolve(undefined);
+        return promise.resolve(undefined);
       }
     }
 
     if (skipReason != null) {
       assert.log('Skipped ' + name + ' ' + skipReason);
-      return Promise.resolve(undefined);
+      return promise.resolve(undefined);
     }
 
     var start = new Date().getTime();
 
     var setupDone = helpers._setup(options, name, audit.setup);
     return setupDone.then(function(chunkLen) {
 
       if (typeof chunkLen !== 'number') {
--- a/browser/devtools/debugger/DebuggerPanel.jsm
+++ b/browser/devtools/debugger/DebuggerPanel.jsm
@@ -7,18 +7,18 @@
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 this.EXPORTED_SYMBOLS = ["DebuggerPanel"];
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource:///modules/devtools/shared/event-emitter.js");
 
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-  "resource://gre/modules/commonjs/sdk/core/promise.js");
+XPCOMUtils.defineLazyModuleGetter(this, "promise",
+  "resource://gre/modules/commonjs/sdk/core/promise.js", "Promise");
 
 this.DebuggerPanel = function DebuggerPanel(iframeWindow, toolbox) {
   this.panelWin = iframeWindow;
   this._toolbox = toolbox;
 
   this._view = this.panelWin.DebuggerView;
   this._controller = this.panelWin.DebuggerController;
   this._controller._target = this.target;
@@ -30,29 +30,29 @@ this.DebuggerPanel = function DebuggerPa
   EventEmitter.decorate(this);
 }
 
 DebuggerPanel.prototype = {
   /**
    * Open is effectively an asynchronous constructor.
    *
    * @return object
-   *         A Promise that is resolved when the Debugger completes opening.
+   *         A promise that is resolved when the Debugger completes opening.
    */
   open: function DebuggerPanel_open() {
-    let promise;
+    let targetPromise;
 
     // Local debugging needs to make the target remote.
     if (!this.target.isRemote) {
-      promise = this.target.makeRemote();
+      targetPromise = this.target.makeRemote();
     } else {
-      promise = Promise.resolve(this.target);
+      targetPromise = promise.resolve(this.target);
     }
 
-    return promise
+    return targetPromise
       .then(() => this._controller.startupDebugger())
       .then(() => this._controller.connect())
       .then(() => {
         this.target.on("thread-paused", this.highlightWhenPaused);
         this.target.on("thread-resumed", this.unhighlightWhenResumed);
         this.isReady = true;
         this.emit("ready");
         return this;
@@ -65,17 +65,17 @@ DebuggerPanel.prototype = {
 
   // DevToolPanel API
   get target() this._toolbox.target,
 
   destroy: function() {
     this.target.off("thread-paused", this.highlightWhenPaused);
     this.target.off("thread-resumed", this.unhighlightWhenResumed);
     this.emit("destroyed");
-    return Promise.resolve(null);
+    return promise.resolve(null);
   },
 
   // DebuggerPanel API
 
   addBreakpoint: function() {
     this._bkp.addBreakpoint.apply(this._bkp, arguments);
   },
 
--- a/browser/devtools/debugger/debugger-controller.js
+++ b/browser/devtools/debugger/debugger-controller.js
@@ -12,17 +12,17 @@ const NEW_SOURCE_IGNORED_URLS = ["debugg
 const NEW_SOURCE_DISPLAY_DELAY = 200; // ms
 const FETCH_SOURCE_RESPONSE_DELAY = 50; // ms
 const FRAME_STEP_CLEAR_DELAY = 100; // ms
 const CALL_STACK_PAGE_SIZE = 25; // frames
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/devtools/dbg-client.jsm");
-Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
+let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js").Promise;
 Cu.import("resource:///modules/source-editor.jsm");
 Cu.import("resource:///modules/devtools/LayoutHelpers.jsm");
 Cu.import("resource:///modules/devtools/BreadcrumbsWidget.jsm");
 Cu.import("resource:///modules/devtools/SideMenuWidget.jsm");
 Cu.import("resource:///modules/devtools/VariablesView.jsm");
 Cu.import("resource:///modules/devtools/VariablesViewController.jsm");
 Cu.import("resource:///modules/devtools/ViewHelpers.jsm");
 
@@ -68,17 +68,17 @@ let DebuggerController = {
     this._isInitialized = true;
 
     // Chrome debugging lives in a different process and needs to handle
     // debugger startup by itself.
     if (window._isChromeDebugger) {
       window.removeEventListener("DOMContentLoaded", this.startupDebugger, true);
     }
 
-    let deferred = this._startup = Promise.defer();
+    let deferred = this._startup = promise.defer();
 
     DebuggerView.initialize(() => {
       DebuggerView._isInitialized = true;
 
       // Chrome debugging needs to initiate the connection by itself.
       if (window._isChromeDebugger) {
         this.connect().then(deferred.resolve);
       } else {
@@ -103,17 +103,17 @@ let DebuggerController = {
     this._startup = null;
 
     // Chrome debugging lives in a different process and needs to handle
     // debugger shutdown by itself.
     if (window._isChromeDebugger) {
       window.removeEventListener("unload", this.shutdownDebugger, true);
     }
 
-    let deferred = this._shutdown = Promise.defer();
+    let deferred = this._shutdown = promise.defer();
 
     DebuggerView.destroy(() => {
       DebuggerView._isDestroyed = true;
 
       this.SourceScripts.disconnect();
       this.StackFrames.disconnect();
       this.ThreadState.disconnect();
 
@@ -137,17 +137,17 @@ let DebuggerController = {
    * @return object
    *         A promise that is resolved when the debugger finishes connecting.
    */
   connect: function() {
     if (this._connection) {
       return this._connection.promise;
     }
 
-    let deferred = this._connection = Promise.defer();
+    let deferred = this._connection = promise.defer();
 
     if (!window._isChromeDebugger) {
       let target = this._target;
       let { client, form, threadActor } = target;
       target.on("close", this._onTabDetached);
       target.on("navigate", this._onTabNavigated);
       target.on("will-navigate", this._onTabNavigated);
 
@@ -1016,17 +1016,17 @@ SourceScripts.prototype = {
    *         A promise that is resolved after the source text has been fetched.
    */
   getTextForSource: function(aSource, aOnTimeout, aDelay = FETCH_SOURCE_RESPONSE_DELAY) {
     // Fetch the source text only once.
     if (aSource._fetched) {
       return aSource._fetched;
     }
 
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
     aSource._fetched = deferred.promise;
 
     // If the source text takes a long time to fetch, invoke a callback.
     if (aOnTimeout) {
       var fetchTimeout = window.setTimeout(() => aOnTimeout(aSource), aDelay);
     }
 
     // Get the source text from the active thread.
@@ -1049,17 +1049,17 @@ SourceScripts.prototype = {
    *
    * @param array aUrls
    *        The urls for the sources to fetch. If fetching a source's text
    *        takes too long, it will be discarded.
    * @return object
    *         A promise that is resolved after source texts have been fetched.
    */
   getTextForSources: function(aUrls) {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
     let pending = new Set(aUrls);
     let fetched = [];
 
     // Can't use Promise.all, because if one fetch operation is rejected, then
     // everything is considered rejected, thus no other subsequent source will
     // be getting fetched. We don't want that. Something like Q's allSettled
     // would work like a charm here.
 
--- a/browser/devtools/debugger/test/browser_dbg_bug883220_raise_on_pause.js
+++ b/browser/devtools/debugger/test/browser_dbg_bug883220_raise_on_pause.js
@@ -8,17 +8,17 @@
 // currently selected tool.
 
 var gTab = null;
 var gTab2 = null;
 var gDebugger = null;
 var gToolbox = null;
 var gToolboxTab = null;
 var gFocusedWindow = null;
-Promise._reportErrors = true;
+promise._reportErrors = true;
 
 function test() {
   debug_tab_pane(STACK_URL, function(aTab, aDebuggee, aPane) {
     gTab = aTab;
     gDebugger = aPane.panelWin;
     gToolbox = aPane._toolbox;
     gToolboxTab = gToolbox.doc.getElementById("toolbox-tab-jsdebugger");
     gBrowser.selectedTab = gTab2 = gBrowser.addTab();
--- a/browser/devtools/debugger/test/browser_dbg_cmd.js
+++ b/browser/devtools/debugger/test/browser_dbg_cmd.js
@@ -2,17 +2,17 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 function test() {
   const TEST_URI = "http://example.com/browser/browser/devtools/debugger/" +
                    "test/browser_dbg_cmd.html";
 
   helpers.addTabWithToolbar(TEST_URI, function(options) {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     let openDone = helpers.audit(options, [{
       setup: "dbg open",
       exec: { output: "", completed: false }
     }]);
 
     openDone.then(function() {
       gDevTools.showToolbox(options.target, "jsdebugger").then(function(toolbox) {
@@ -100,9 +100,9 @@ function test() {
             }]);
           });
         });
       });
     });
 
     return deferred.promise;
   }).then(finish);
-}
\ No newline at end of file
+}
--- a/browser/devtools/debugger/test/browser_dbg_cmd_break.js
+++ b/browser/devtools/debugger/test/browser_dbg_cmd_break.js
@@ -37,17 +37,17 @@ function test() {
           hints:                ' <file> <line>',
           markup: 'VVVVVVVVVVVVVV',
           status: 'ERROR'
         },
       },
       {
         name: 'open toolbox',
         setup: function() {
-          var deferred = Promise.defer();
+          var deferred = promise.defer();
 
           var openDone = gDevTools.showToolbox(options.target, "jsdebugger");
           openDone.then(function(toolbox) {
             let dbg = toolbox.getCurrentPanel();
             ok(dbg, "DebuggerPanel exists");
 
             // Wait for the initial resume...
             dbg.panelWin.gClient.addOneTimeListener("resumed", function() {
@@ -123,17 +123,17 @@ function test() {
             /cmd_break\.html:13/
           ]
         },
       },
       {
         name: 'cleanup',
         setup: function() {
           // a.k.a "return client.activeThread.resume();"
-          var deferred = Promise.defer();
+          var deferred = promise.defer();
           client.activeThread.resume(function() {
             deferred.resolve();
           });
           return deferred.promise;
         },
       },
       {
         setup: 'break del 0',
--- a/browser/devtools/framework/gDevTools.jsm
+++ b/browser/devtools/framework/gDevTools.jsm
@@ -6,17 +6,17 @@
 
 this.EXPORTED_SYMBOLS = [ "gDevTools", "DevTools", "gDevToolsBrowser" ];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource:///modules/devtools/shared/event-emitter.js");
-Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
+let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js").Promise;
 Cu.import("resource://gre/modules/devtools/Loader.jsm");
 
 var ProfilerController = devtools.require("devtools/profiler/controller");
 
 const FORBIDDEN_IDS = new Set(["toolbox", ""]);
 const MAX_ORDINAL = 99;
 
 /**
@@ -182,32 +182,32 @@ DevTools.prototype = {
    *        The id of the tool to show
    * @param {Toolbox.HostType} hostType
    *        The type of host (bottom, window, side)
    *
    * @return {Toolbox} toolbox
    *        The toolbox that was opened
    */
   showToolbox: function(target, toolId, hostType) {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     let toolbox = this._toolboxes.get(target);
     if (toolbox) {
 
-      let promise = (hostType != null && toolbox.hostType != hostType) ?
+      let hostPromise = (hostType != null && toolbox.hostType != hostType) ?
           toolbox.switchHost(hostType) :
-          Promise.resolve(null);
+          promise.resolve(null);
 
       if (toolId != null && toolbox.currentToolId != toolId) {
-        promise = promise.then(function() {
+        hostPromise = hostPromise.then(function() {
           return toolbox.selectTool(toolId);
         });
       }
 
-      return promise.then(function() {
+      return hostPromise.then(function() {
         toolbox.raise();
         return toolbox;
       });
     }
     else {
       // No toolbox for target, create one
       toolbox = new devtools.Toolbox(target, toolId, hostType);
 
--- a/browser/devtools/framework/sidebar.js
+++ b/browser/devtools/framework/sidebar.js
@@ -3,17 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const {Cu} = require("chrome");
 
 Cu.import("resource://gre/modules/Services.jsm");
 
-var Promise = require("sdk/core/promise");
+var promise = require("sdk/core/promise");
 var EventEmitter = require("devtools/shared/event-emitter");
 var Telemetry = require("devtools/shared/telemetry");
 
 const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 
 /**
  * ToolSidebar provides methods to register tabs in the sidebar.
  * It's assumed that the sidebar contains a xul:tabbox.
@@ -207,17 +207,17 @@ ToolSidebar.prototype = {
     return panel.firstChild.contentWindow;
   },
 
   /**
    * Clean-up.
    */
   destroy: function ToolSidebar_destroy() {
     if (this._destroyed) {
-      return Promise.resolve(null);
+      return promise.resolve(null);
     }
     this._destroyed = true;
 
     Services.prefs.setIntPref("devtools.toolsidebar-width." + this._uid, this._tabbox.width);
 
     this._tabbox.tabpanels.removeEventListener("select", this, true);
 
     while (this._tabbox.tabpanels.hasChildNodes()) {
@@ -232,11 +232,11 @@ ToolSidebar.prototype = {
       this._telemetry.toolClosed(this._currentTool);
     }
 
     this._tabs = null;
     this._tabbox = null;
     this._panelDoc = null;
     this._toolPanel = null;
 
-    return Promise.resolve(null);
+    return promise.resolve(null);
   },
 }
--- a/browser/devtools/framework/target.js
+++ b/browser/devtools/framework/target.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {Cc, Ci, Cu} = require("chrome");
 
-var Promise = require("sdk/core/promise");
+var promise = require("sdk/core/promise");
 var EventEmitter = require("devtools/shared/event-emitter");
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "DebuggerServer",
   "resource://gre/modules/devtools/dbg-server.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "DebuggerClient",
   "resource://gre/modules/devtools/dbg-client.jsm");
 
@@ -48,23 +48,23 @@ exports.TargetFactory = {
    *          form: the remote protocol form of a tab,
    *          client: a DebuggerClient instance,
    *          chrome: true if the remote target is the whole process
    *        }
    *
    * @return A promise of a target object
    */
   forRemoteTab: function TF_forRemoteTab(options) {
-    let promise = promiseTargets.get(options);
-    if (promise == null) {
+    let targetPromise = promiseTargets.get(options);
+    if (targetPromise == null) {
       let target = new TabTarget(options);
-      promise = target.makeRemote().then(() => target);
-      promiseTargets.set(options, promise);
+      targetPromise = target.makeRemote().then(() => target);
+      promiseTargets.set(options, targetPromise);
     }
-    return promise;
+    return targetPromise;
   },
 
   /**
    * Creating a target for a tab that is being closed is a problem because it
    * allows a leak as a result of coming after the close event which normally
    * clears things up. This function allows us to ask if there is a known
    * target for a tab without creating a target
    * @return true/false
@@ -268,17 +268,17 @@ TabTarget.prototype = {
    * for tools that support the Remote Debugging Protocol even for local
    * connections.
    */
   makeRemote: function TabTarget_makeRemote() {
     if (this._remote) {
       return this._remote.promise;
     }
 
-    this._remote = Promise.defer();
+    this._remote = promise.defer();
 
     if (this.isLocalTab) {
       // Since a remote protocol connection will be made, let's start the
       // DebuggerServer here, once and for all tools.
       if (!DebuggerServer.initialized) {
         DebuggerServer.init();
         DebuggerServer.addBrowserActors();
       }
@@ -396,17 +396,17 @@ TabTarget.prototype = {
    */
   destroy: function() {
     // If several things call destroy then we give them all the same
     // destruction promise so we're sure to destroy only once
     if (this._destroyer) {
       return this._destroyer.promise;
     }
 
-    this._destroyer = Promise.defer();
+    this._destroyer = promise.defer();
 
     // Before taking any action, notify listeners that destruction is imminent.
     this.emit("close");
 
     // First of all, do cleanup tasks that pertain to both remoted and
     // non-remoted targets.
     this.off("thread-resumed", this._handleThreadState);
     this.off("thread-paused", this._handleThreadState);
@@ -600,15 +600,15 @@ WindowTarget.prototype = {
       this.off("thread-paused", this._handleThreadState);
       this.off("thread-resumed", this._handleThreadState);
       this.emit("close");
 
       targets.delete(this._window);
       this._window = null;
     }
 
-    return Promise.resolve(null);
+    return promise.resolve(null);
   },
 
   toString: function() {
     return 'WindowTarget:' + this.window;
   },
 };
--- a/browser/devtools/framework/test/browser_devtools_api.js
+++ b/browser/devtools/framework/test/browser_devtools_api.js
@@ -92,17 +92,17 @@ function DevToolPanel(iframeWindow, tool
   let textNode = doc.createTextNode("Some Tool");
 
   label.appendChild(textNode);
   doc.body.appendChild(label);*/
 }
 
 DevToolPanel.prototype = {
   open: function() {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     executeSoon(function() {
       this._isReady = true;
       this.emit("ready");
       deferred.resolve(this);
     }.bind(this));
 
     return deferred.promise;
@@ -112,11 +112,11 @@ DevToolPanel.prototype = {
 
   get toolbox() this._toolbox,
 
   get isReady() this._isReady,
 
   _isReady: false,
 
   destroy: function DTI_destroy() {
-    return Promise.defer(null);
+    return promise.defer(null);
   },
 };
--- a/browser/devtools/framework/test/browser_toolbox_options_disablejs.js
+++ b/browser/devtools/framework/test/browser_toolbox_options_disablejs.js
@@ -60,17 +60,17 @@ function testJSEnabledIframe(secondPass)
   if (secondPass) {
     finishUp();
   } else {
     toggleJS().then(testJSDisabled);
   }
 }
 
 function toggleJS() {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
   let panel = toolbox.getCurrentPanel();
   let cbx = panel.panelDoc.getElementById("devtools-disable-javascript");
 
   cbx.scrollIntoView();
 
   if (cbx.checked) {
     info("Clearing checkbox to re-enable JS");
   } else {
--- a/browser/devtools/framework/test/browser_toolbox_sidebar.js
+++ b/browser/devtools/framework/test/browser_toolbox_sidebar.js
@@ -24,17 +24,17 @@ function test() {
 
   let toolDefinition = {
     id: "fakeTool4242",
     visibilityswitch: "devtools.fakeTool4242.enabled",
     url: toolURL,
     label: "FAKE TOOL!!!",
     isTargetSupported: function() true,
     build: function(iframeWindow, toolbox) {
-      let deferred = Promise.defer();
+      let deferred = promise.defer();
       executeSoon(function() {
         deferred.resolve({
           target: toolbox.target,
           toolbox: toolbox,
           isReady: true,
           destroy: function(){},
           panelDoc: iframeWindow.document,
         });
--- a/browser/devtools/framework/test/browser_toolbox_window_title_changes.js
+++ b/browser/devtools/framework/test/browser_toolbox_window_title_changes.js
@@ -32,17 +32,17 @@ function test() {
       .then(checkTitle.bind(null, LABEL_1, URL_1, "toolbox undocked"))
 
     // switch to different tool and check title
       .then(function () toolbox.selectTool(TOOL_ID_2))
       .then(checkTitle.bind(null, LABEL_2, URL_1, "tool changed"))
 
     // navigate to different url and check title
       .then(function () {
-        let deferred = Promise.defer();
+        let deferred = promise.defer();
         target.once("navigate", function () deferred.resolve());
         gBrowser.loadURI(URL_2);
         return deferred.promise;
       })
       .then(checkTitle.bind(null, LABEL_2, URL_2, "url changed"))
 
     // destroy toolbox, create new one hosted in a window (with a
     // different tool id), and check title
--- a/browser/devtools/framework/test/head.js
+++ b/browser/devtools/framework/test/head.js
@@ -3,34 +3,34 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 let TargetFactory = gDevTools.TargetFactory;
 
 let tempScope = {};
 Components.utils.import("resource://gre/modules/devtools/Console.jsm", tempScope);
 let console = tempScope.console;
 Components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js", tempScope);
-let Promise = tempScope.Promise;
+let promise = tempScope.Promise;
 
 let {devtools} = Components.utils.import("resource://gre/modules/devtools/Loader.jsm", {});
 let TargetFactory = devtools.TargetFactory;
 
 /**
  * Open a new tab at a URL and call a callback on load
  */
 function addTab(aURL, aCallback)
 {
   waitForExplicitFinish();
 
   gBrowser.selectedTab = gBrowser.addTab();
   if (aURL != null) {
     content.location = aURL;
   }
 
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   let tab = gBrowser.selectedTab;
   let target = TargetFactory.forTab(gBrowser.selectedTab);
   let browser = gBrowser.getBrowserForTab(tab);
 
   function onTabLoad() {
     browser.removeEventListener("load", onTabLoad, true);
 
--- a/browser/devtools/framework/toolbox-hosts.js
+++ b/browser/devtools/framework/toolbox-hosts.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {Cu} = require("chrome");
 
-let Promise = require("sdk/core/promise");
+let promise = require("sdk/core/promise");
 let EventEmitter = require("devtools/shared/event-emitter");
 
 Cu.import("resource://gre/modules/Services.jsm");
 
 /**
  * A toolbox host represents an object that contains a toolbox (e.g. the
  * sidebar or a separate window). Any host object should implement the
  * following functions:
@@ -39,17 +39,17 @@ BottomHost.prototype = {
   type: "bottom",
 
   heightPref: "devtools.toolbox.footer.height",
 
   /**
    * Create a box at the bottom of the host tab.
    */
   create: function BH_create() {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     let gBrowser = this.hostTab.ownerDocument.defaultView.gBrowser;
     let ownerDocument = gBrowser.ownerDocument;
 
     this._splitter = ownerDocument.createElement("splitter");
     this._splitter.setAttribute("class", "devtools-horizontal-splitter");
 
     this.frame = ownerDocument.createElement("iframe");
@@ -99,17 +99,17 @@ BottomHost.prototype = {
     if (!this._destroyed) {
       this._destroyed = true;
 
       Services.prefs.setIntPref(this.heightPref, this.frame.height);
       this._nbox.removeChild(this._splitter);
       this._nbox.removeChild(this.frame);
     }
 
-    return Promise.resolve(null);
+    return promise.resolve(null);
   }
 }
 
 
 /**
  * Host object for the in-browser sidebar
  */
 function SidebarHost(hostTab) {
@@ -122,17 +122,17 @@ SidebarHost.prototype = {
   type: "side",
 
   widthPref: "devtools.toolbox.sidebar.width",
 
   /**
    * Create a box in the sidebar of the host tab.
    */
   create: function SH_create() {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     let gBrowser = this.hostTab.ownerDocument.defaultView.gBrowser;
     let ownerDocument = gBrowser.ownerDocument;
 
     this._splitter = ownerDocument.createElement("splitter");
     this._splitter.setAttribute("class", "devtools-side-splitter");
 
     this.frame = ownerDocument.createElement("iframe");
@@ -180,17 +180,17 @@ SidebarHost.prototype = {
     if (!this._destroyed) {
       this._destroyed = true;
 
       Services.prefs.setIntPref(this.widthPref, this.frame.width);
       this._sidebar.removeChild(this._splitter);
       this._sidebar.removeChild(this.frame);
     }
 
-    return Promise.resolve(null);
+    return promise.resolve(null);
   }
 }
 
 /**
  * Host object for the toolbox in a separate window
  */
 function WindowHost() {
   this._boundUnload = this._boundUnload.bind(this);
@@ -202,17 +202,17 @@ WindowHost.prototype = {
   type: "window",
 
   WINDOW_URL: "chrome://browser/content/devtools/framework/toolbox-window.xul",
 
   /**
    * Create a new xul window to contain the toolbox.
    */
   create: function WH_create() {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     let flags = "chrome,centerscreen,resizable,dialog=no";
     let win = Services.ww.openWindow(null, this.WINDOW_URL, "_blank",
                                      flags, null);
 
     let frameLoad = function(event) {
       win.removeEventListener("load", frameLoad, true);
       this.frame = win.document.getElementById("toolbox-iframe");
@@ -263,17 +263,17 @@ WindowHost.prototype = {
   destroy: function WH_destroy() {
     if (!this._destroyed) {
       this._destroyed = true;
 
       this._window.removeEventListener("unload", this._boundUnload);
       this._window.close();
     }
 
-    return Promise.resolve(null);
+    return promise.resolve(null);
   }
 }
 
 /**
  *  Switch to the given tab in a browser and focus the browser window
  */
 function focusTab(tab) {
   let browserWindow = tab.ownerDocument.defaultView;
--- a/browser/devtools/framework/toolbox-options.js
+++ b/browser/devtools/framework/toolbox-options.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {Cu, Cc, Ci} = require("chrome");
 
-let Promise = require("sdk/core/promise");
+let promise = require("sdk/core/promise");
 let EventEmitter = require("devtools/shared/event-emitter");
 
 Cu.import('resource://gre/modules/XPCOMUtils.jsm');
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource:///modules/devtools/gDevTools.jsm");
 
 exports.OptionsPanel = OptionsPanel;
 
@@ -48,17 +48,17 @@ function OptionsPanel(iframeWindow, tool
 
 OptionsPanel.prototype = {
 
   get target() {
     return this.toolbox.target;
   },
 
   open: function() {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     this.setupToolsList();
     this.populatePreferences();
     this.prepareRestartPreferences();
 
     this._disableJSClicked = this._disableJSClicked.bind(this);
 
     let disableJSNode = this.panelDoc.getElementById("devtools-disable-javascript");
--- a/browser/devtools/framework/toolbox.js
+++ b/browser/devtools/framework/toolbox.js
@@ -1,17 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {Cc, Ci, Cu} = require("chrome");
 const MAX_ORDINAL = 99;
-let Promise = require("sdk/core/promise");
+let promise = require("sdk/core/promise");
 let EventEmitter = require("devtools/shared/event-emitter");
 let Telemetry = require("devtools/shared/telemetry");
 
 Cu.import('resource://gre/modules/XPCOMUtils.jsm');
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource:///modules/devtools/gDevTools.jsm");
 
 loader.lazyGetter(this, "Hosts", () => require("devtools/framework/toolbox-hosts").Hosts);
@@ -186,17 +186,17 @@ Toolbox.prototype = {
   get doc() {
     return this.frame.contentDocument;
   },
 
   /**
    * Open the toolbox
    */
   open: function TBOX_open() {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     this._host.create().then(iframe => {
       let domReady = () => {
         iframe.removeEventListener("DOMContentLoaded", domReady, true);
 
         this.isReady = true;
 
         let closeButton = this.doc.getElementById("toolbox-close");
@@ -422,17 +422,17 @@ Toolbox.prototype = {
 
   /**
    * Ensure the tool with the given id is loaded.
    *
    * @param {string} id
    *        The id of the tool to load.
    */
   loadTool: function TBOX_loadTool(id) {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
     let iframe = this.doc.getElementById("toolbox-panel-iframe-" + id);
 
     if (iframe) {
       let panel = this._toolPanels.get(id);
       if (panel) {
         deferred.resolve(panel);
       } else {
         this.once(id + "-ready", (panel) => {
@@ -456,17 +456,17 @@ Toolbox.prototype = {
 
     let vbox = this.doc.getElementById("toolbox-panel-" + id);
     vbox.appendChild(iframe);
 
     let onLoad = () => {
       iframe.removeEventListener("DOMContentLoaded", onLoad, true);
 
       let built = definition.build(iframe.contentWindow, this);
-      Promise.resolve(built).then((panel) => {
+      promise.resolve(built).then((panel) => {
         this._toolPanels.set(id, panel);
         this.emit(id + "-ready", panel);
         gDevTools.emit(id + "-ready", this, panel);
         deferred.resolve(panel);
       });
     };
 
     iframe.addEventListener("DOMContentLoaded", onLoad, true);
@@ -487,17 +487,17 @@ Toolbox.prototype = {
     }
     let tab = this.doc.getElementById("toolbox-tab-" + id);
     tab.setAttribute("selected", "true");
 
     let prevToolId = this._currentToolId;
 
     if (this._currentToolId == id) {
       // Return the existing panel in order to have a consistent return value.
-      return Promise.resolve(this._toolPanels.get(id));
+      return promise.resolve(this._toolPanels.get(id));
     }
 
     if (!this.isReady) {
       throw new Error("Can't select tool, wait for toolbox 'ready' event");
     }
     let tab = this.doc.getElementById("toolbox-tab-" + id);
 
     if (tab) {
@@ -729,17 +729,17 @@ Toolbox.prototype = {
     // If several things call destroy then we give them all the same
     // destruction promise so we're sure to destroy only once
     if (this._destroyer) {
       return this._destroyer;
     }
     // Assign the "_destroyer" property before calling the other
     // destroyer methods to guarantee that the Toolbox's destroy
     // method is only executed once.
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
     this._destroyer = deferred.promise;
 
     this._target.off("navigate", this._refreshHostTitle);
     this.off("select", this._refreshHostTitle);
     this.off("host-changed", this._refreshHostTitle);
 
     gDevTools.off("tool-registered", this._toolRegistered);
     gDevTools.off("tool-unregistered", this._toolUnregistered);
@@ -770,17 +770,17 @@ Toolbox.prototype = {
     // Targets need to be notified that the toolbox is being torn down, so that
     // remote protocol connections can be gracefully terminated.
     if (this._target) {
       this._target.off("close", this.destroy);
       outstanding.push(this._target.destroy());
     }
     this._target = null;
 
-    Promise.all(outstanding).then(function() {
+    promise.all(outstanding).then(function() {
       this.emit("destroyed");
       // Free _host after the call to destroyed in order to let a chance
       // to destroyed listeners to still query toolbox attributes
       this._host = null;
       deferred.resolve();
     }.bind(this));
 
     return this._destroyer;
--- a/browser/devtools/inspector/inspector-panel.js
+++ b/browser/devtools/inspector/inspector-panel.js
@@ -3,17 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const {Cc, Ci, Cu, Cr} = require("chrome");
 
 Cu.import("resource://gre/modules/Services.jsm");
 
-let Promise = require("sdk/core/promise");
+let promise = require("sdk/core/promise");
 let EventEmitter = require("devtools/shared/event-emitter");
 let {CssLogic} = require("devtools/styleinspector/css-logic");
 
 loader.lazyGetter(this, "MarkupView", () => require("devtools/markupview/markup-view").MarkupView);
 loader.lazyGetter(this, "Selection", () => require("devtools/inspector/selection").Selection);
 loader.lazyGetter(this, "HTMLBreadcrumbs", () => require("devtools/inspector/breadcrumbs").HTMLBreadcrumbs);
 loader.lazyGetter(this, "Highlighter", () => require("devtools/inspector/highlighter").Highlighter);
 loader.lazyGetter(this, "ToolSidebar", () => require("devtools/framework/sidebar").ToolSidebar);
@@ -53,17 +53,17 @@ InspectorPanel.prototype = {
       this.walker = walker;
       return this._getDefaultNodeForSelection();
     }).then(defaultSelection => {
       return this._deferredOpen(defaultSelection);
     }).then(null, console.error);
   },
 
   _deferredOpen: function(defaultSelection) {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     this.onNavigatedAway = this.onNavigatedAway.bind(this);
     this.target.on("navigate", this.onNavigatedAway);
 
     this.nodemenu = this.panelDoc.getElementById("inspector-node-popup");
     this.lastNodemenuItem = this.nodemenu.lastChild;
     this._setupNodeMenu = this._setupNodeMenu.bind(this);
     this._resetNodeMenu = this._resetNodeMenu.bind(this);
@@ -400,17 +400,17 @@ InspectorPanel.prototype = {
   destroy: function InspectorPanel__destroy() {
     if (this._destroyPromise) {
       return this._destroyPromise;
     }
     if (this.walker) {
       this._destroyPromise = this.walker.release().then(null, console.error);
       delete this.walker;
     } else {
-      this._destroyPromise = Promise.resolve(null);
+      this._destroyPromise = promise.resolve(null);
     }
 
     this.cancelUpdate();
     this.cancelLayoutChange();
 
     if (this.browser) {
       this.browser.removeEventListener("resize", this.scheduleLayoutChange, true);
       this.browser = null;
--- a/browser/devtools/inspector/test/browser_inspector_bug_840156_destroy_after_navigation.js
+++ b/browser/devtools/inspector/test/browser_inspector_bug_840156_destroy_after_navigation.js
@@ -1,27 +1,27 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-let Promise = devtools.require("sdk/core/promise");
+let promise = devtools.require("sdk/core/promise");
 let Toolbox = devtools.Toolbox;
 let TargetFactory = devtools.TargetFactory;
 
 function test() {
   waitForExplicitFinish();
 
   const URL_1 = "data:text/plain;charset=UTF-8,abcde";
   const URL_2 = "data:text/plain;charset=UTF-8,12345";
 
   let target, toolbox;
 
   // open tab, load URL_1, and wait for load to finish
   let tab = gBrowser.selectedTab = gBrowser.addTab();
   let target = TargetFactory.forTab(gBrowser.selectedTab);
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
   let browser = gBrowser.getBrowserForTab(tab);
   function onTabLoad() {
     browser.removeEventListener("load", onTabLoad, true);
     deferred.resolve(null);
   }
   browser.addEventListener("load", onTabLoad, true);
   browser.loadURI(URL_1);
 
@@ -30,17 +30,17 @@ function test() {
     .then(function () gDevTools.showToolbox(target, null, Toolbox.HostType.BOTTOM))
     .then(function (aToolbox) { toolbox = aToolbox; })
 
   // select the inspector
     .then(function () toolbox.selectTool("inspector"))
 
   // navigate to URL_2
     .then(function () {
-      let deferred = Promise.defer();
+      let deferred = promise.defer();
       target.once("navigate", function () deferred.resolve());
       browser.loadURI(URL_2);
       return deferred.promise;
     })
 
   // destroy the toolbox (and hence the inspector) before the load completes
     .then(function () toolbox.destroy())
 
--- a/browser/devtools/netmonitor/NetMonitorPanel.jsm
+++ b/browser/devtools/netmonitor/NetMonitorPanel.jsm
@@ -7,18 +7,18 @@
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 this.EXPORTED_SYMBOLS = ["NetMonitorPanel"];
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource:///modules/devtools/shared/event-emitter.js");
 
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-  "resource://gre/modules/commonjs/sdk/core/promise.js");
+XPCOMUtils.defineLazyModuleGetter(this, "promise",
+  "resource://gre/modules/commonjs/sdk/core/promise.js", "Promise");
 
 this.NetMonitorPanel = function NetMonitorPanel(iframeWindow, toolbox) {
   this.panelWin = iframeWindow;
   this._toolbox = toolbox;
   this._destroyer = null;
 
   this._view = this.panelWin.NetMonitorView;
   this._controller = this.panelWin.NetMonitorController;
@@ -27,29 +27,29 @@ this.NetMonitorPanel = function NetMonit
   EventEmitter.decorate(this);
 };
 
 NetMonitorPanel.prototype = {
   /**
    * Open is effectively an asynchronous constructor.
    *
    * @return object
-   *         A Promise that is resolved when the NetMonitor completes opening.
+   *         A promise that is resolved when the NetMonitor completes opening.
    */
   open: function() {
-    let promise;
+    let targetPromise;
 
     // Local monitoring needs to make the target remote.
     if (!this.target.isRemote) {
-      promise = this.target.makeRemote();
+      targetPromise = this.target.makeRemote();
     } else {
-      promise = Promise.resolve(this.target);
+      targetPromise = promise.resolve(this.target);
     }
 
-    return promise
+    return targetPromise
       .then(() => this._controller.startupNetMonitor())
       .then(() => this._controller.connect())
       .then(() => {
         this.isReady = true;
         this.emit("ready");
         return this;
       })
       .then(null, function onError(aReason) {
--- a/browser/devtools/netmonitor/netmonitor-controller.js
+++ b/browser/devtools/netmonitor/netmonitor-controller.js
@@ -4,17 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
+let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js").Promise;
 Cu.import("resource:///modules/source-editor.jsm");
 Cu.import("resource:///modules/devtools/shared/event-emitter.js");
 Cu.import("resource:///modules/devtools/SideMenuWidget.jsm");
 Cu.import("resource:///modules/devtools/VariablesView.jsm");
 Cu.import("resource:///modules/devtools/ViewHelpers.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
   "resource://gre/modules/PluralForm.jsm");
@@ -43,17 +43,17 @@ let NetMonitorController = {
   startupNetMonitor: function() {
     if (this._startup) {
       return this._startup;
     }
 
     NetMonitorView.initialize();
 
     // Startup is synchronous, for now.
-    return this._startup = Promise.resolve();
+    return this._startup = promise.resolve();
   },
 
   /**
    * Destroys the view and disconnects the monitor client from the server.
    *
    * @return object
    *         A promise that is resolved when the monitor finishes shutdown.
    */
@@ -63,32 +63,32 @@ let NetMonitorController = {
     }
 
     NetMonitorView.destroy();
     this.TargetEventsHandler.disconnect();
     this.NetworkEventsHandler.disconnect();
     this.disconnect();
 
     // Shutdown is synchronous, for now.
-    return this._shutdown = Promise.resolve();
+    return this._shutdown = promise.resolve();
   },
 
   /**
    * Initiates remote or chrome network monitoring based on the current target,
    * wiring event handlers as necessary.
    *
    * @return object
    *         A promise that is resolved when the monitor finishes connecting.
    */
   connect: function() {
     if (this._connection) {
       return this._connection;
     }
 
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
     this._connection = deferred.promise;
 
     let target = this._target;
     let { client, form } = target;
     if (target.chrome) {
       this._startChromeMonitoring(client, form.consoleActor, deferred.resolve);
     } else {
       this._startMonitoringTab(client, form, deferred.resolve);
@@ -480,24 +480,24 @@ NetworkEventsHandler.prototype = {
    *        then a promise of the same string is simply returned.
    * @return object Promise
    *         A promise that is resolved when the full string contents
    *         are available, or rejected if something goes wrong.
    */
   getString: function(aStringGrip) {
     // Make sure this is a long string.
     if (typeof aStringGrip != "object" || aStringGrip.type != "longString") {
-      return Promise.resolve(aStringGrip); // Go home string, you're drunk.
+      return promise.resolve(aStringGrip); // Go home string, you're drunk.
     }
     // Fetch the long string only once.
     if (aStringGrip._fullText) {
       return aStringGrip._fullText.promise;
     }
 
-    let deferred = aStringGrip._fullText = Promise.defer();
+    let deferred = aStringGrip._fullText = promise.defer();
     let { actor, initial, length } = aStringGrip;
     let longStringClient = this.webConsoleClient.longString(aStringGrip);
 
     longStringClient.substring(initial.length, length, aResponse => {
       if (aResponse.error) {
         Cu.reportError(aResponse.error + ": " + aResponse.message);
         deferred.reject(aResponse);
         return;
--- a/browser/devtools/netmonitor/netmonitor-view.js
+++ b/browser/devtools/netmonitor/netmonitor-view.js
@@ -156,26 +156,26 @@ let NetMonitorView = {
   },
 
   /**
    * Lazily initializes and returns a promise for a SourceEditor instance.
    *
    * @param string aId
    *        The id of the editor placeholder node.
    * @return object
-   *         A Promise that is resolved when the editor is available.
+   *         A promise that is resolved when the editor is available.
    */
   editor: function(aId) {
     dumpn("Getting a NetMonitorView editor: " + aId);
 
     if (this._editorPromises.has(aId)) {
       return this._editorPromises.get(aId);
     }
 
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
     this._editorPromises.set(aId, deferred.promise);
 
     // Initialize the source editor and store the newly created instance
     // in the ether of a resolved promise's value.
     new SourceEditor().init($(aId), DEFAULT_EDITOR_CONFIG, deferred.resolve);
 
     return deferred.promise;
   },
--- a/browser/devtools/netmonitor/test/browser_net_content-type.js
+++ b/browser/devtools/netmonitor/test/browser_net_content-type.js
@@ -175,33 +175,33 @@ function test() {
             is(jsonScope.querySelectorAll(".variables-view-property .value")[0].getAttribute("value"),
               "\"Hello JSON!\"", "The first json property value was incorrect.");
 
             is(jsonScope.querySelectorAll(".variables-view-property .name")[1].getAttribute("value"),
               "__proto__", "The second json property name was incorrect.");
             is(jsonScope.querySelectorAll(".variables-view-property .value")[1].getAttribute("value"),
               "Object", "The second json property value was incorrect.");
 
-            return Promise.resolve();
+            return promise.resolve();
           }
           case "html": {
             checkVisibility("textarea");
 
             return NetMonitorView.editor("#response-content-textarea").then((aEditor) => {
               is(aEditor.getText(), "<blink>Not Found</blink>",
                 "The text shown in the source editor is incorrect for the xml request.");
               is(aEditor.getMode(), SourceEditor.MODES.HTML,
                 "The mode active in the source editor is incorrect for the xml request.");
             });
           }
           case "png": {
             checkVisibility("image");
 
             let imageNode = tabpanel.querySelector("#response-content-image");
-            let deferred = Promise.defer();
+            let deferred = promise.defer();
 
             imageNode.addEventListener("load", function onLoad() {
               imageNode.removeEventListener("load", onLoad);
 
               is(tabpanel.querySelector("#response-content-image-name-value")
                 .getAttribute("value"), "test-image.png",
                 "The image name info isn't correct.");
               is(tabpanel.querySelector("#response-content-image-mime-value")
--- a/browser/devtools/netmonitor/test/browser_net_filter-01.js
+++ b/browser/devtools/netmonitor/test/browser_net_filter-01.js
@@ -171,14 +171,14 @@ function test() {
         "GET", CONTENT_TYPE_SJS + "?fmt=flash", {
           fuzzyUrl: true,
           status: 200,
           statusText: "OK",
           type: "x-shockwave-flash",
           fullMimeType: "application/x-shockwave-flash"
       });
 
-      return Promise.resolve(null);
+      return promise.resolve(null);
     }
 
     aDebuggee.performRequests('{ "getMedia": true, "getFlash": true }');
   });
 }
--- a/browser/devtools/netmonitor/test/browser_net_filter-02.js
+++ b/browser/devtools/netmonitor/test/browser_net_filter-02.js
@@ -168,14 +168,14 @@ function test() {
             fuzzyUrl: true,
             status: 200,
             statusText: "OK",
             type: "x-shockwave-flash",
             fullMimeType: "application/x-shockwave-flash"
         });
       }
 
-      return Promise.resolve(null);
+      return promise.resolve(null);
     }
 
     aDebuggee.performRequests('{ "getMedia": true, "getFlash": true }');
   });
 }
--- a/browser/devtools/netmonitor/test/browser_net_filter-03.js
+++ b/browser/devtools/netmonitor/test/browser_net_filter-03.js
@@ -172,15 +172,15 @@ function test() {
             fuzzyUrl: true,
             status: 200,
             statusText: "OK",
             type: "webm",
             fullMimeType: "video/webm"
         });
       }
 
-      return Promise.resolve(null);
+      return promise.resolve(null);
     }
 
     let str = "'<p>'" + new Array(10).join(Math.random(10)) + "'</p>'";
     aDebuggee.performRequests('{ "htmlContent": "' + str + '", "getMedia": true }');
   });
 }
--- a/browser/devtools/netmonitor/test/browser_net_post-data-01.js
+++ b/browser/devtools/netmonitor/test/browser_net_post-data-01.js
@@ -109,17 +109,17 @@ function test() {
             "foo", "The first post param name was incorrect.");
           is(postScope.querySelectorAll(".variables-view-variable .value")[0].getAttribute("value"),
             "\"bar\"", "The first post param value was incorrect.");
           is(postScope.querySelectorAll(".variables-view-variable .name")[1].getAttribute("value"),
             "baz", "The second post param name was incorrect.");
           is(postScope.querySelectorAll(".variables-view-variable .value")[1].getAttribute("value"),
             "\"123\"", "The second post param value was incorrect.");
 
-          return Promise.resolve();
+          return promise.resolve();
         }
         else {
           checkVisibility("params textarea");
 
           is(tabpanel.querySelectorAll(".variables-view-variable").length, 3,
             "There should be 3 param values displayed in this tabpanel.");
           is(queryScope.querySelectorAll(".variables-view-variable").length, 3,
             "There should be 3 param values displayed in the query scope.");
--- a/browser/devtools/netmonitor/test/browser_net_sort-01.js
+++ b/browser/devtools/netmonitor/test/browser_net_sort-01.js
@@ -235,14 +235,14 @@ function test() {
           status: 501,
           statusText: "Not Implemented",
           type: "plain",
           fullMimeType: "text/plain; charset=utf-8",
           size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.02),
           time: true
         });
 
-      return Promise.resolve(null);
+      return promise.resolve(null);
     }
 
     aDebuggee.performRequests();
   });
 }
--- a/browser/devtools/netmonitor/test/browser_net_sort-02.js
+++ b/browser/devtools/netmonitor/test/browser_net_sort-02.js
@@ -236,14 +236,14 @@ function test() {
           status: 500,
           statusText: "Meh",
           type: "5",
           fullMimeType: "text/5",
           size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.04),
           time: true
         });
 
-      return Promise.resolve(null);
+      return promise.resolve(null);
     }
 
     aDebuggee.performRequests();
   });
 }
--- a/browser/devtools/netmonitor/test/browser_net_sort-03.js
+++ b/browser/devtools/netmonitor/test/browser_net_sort-03.js
@@ -164,14 +164,14 @@ function test() {
             statusText: "Meh",
             type: "5",
             fullMimeType: "text/5",
             size: L10N.getFormatStrWithNumbers("networkMenu.sizeKB", 0.04),
             time: true
           });
       }
 
-      return Promise.resolve(null);
+      return promise.resolve(null);
     }
 
     aDebuggee.performRequests();
   });
 }
--- a/browser/devtools/netmonitor/test/head.js
+++ b/browser/devtools/netmonitor/test/head.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
    http://creativecommons.org/publicdomain/zero/1.0/ */
 "use strict";
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
-let { Promise } = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
+let { Promise: promise } = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
 let { gDevTools } = Cu.import("resource:///modules/devtools/gDevTools.jsm", {});
 let { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
 let TargetFactory = devtools.TargetFactory;
 let Toolbox = devtools.Toolbox;
 
 const EXAMPLE_URL = "http://example.com/browser/browser/devtools/netmonitor/test/";
 
 const SIMPLE_URL = EXAMPLE_URL + "html_simple-test-page.html";
@@ -45,17 +45,17 @@ Services.prefs.setBoolPref("devtools.deb
 registerCleanupFunction(() => {
   info("finish() was called, cleaning up...");
   Services.prefs.setBoolPref("devtools.debugger.log", gEnableLogging);
 });
 
 function addTab(aUrl, aWindow) {
   info("Adding tab: " + aUrl);
 
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
   let targetWindow = aWindow || window;
   let targetBrowser = targetWindow.gBrowser;
 
   targetWindow.focus();
   let tab = targetBrowser.selectedTab = targetBrowser.addTab(aUrl);
   let browser = tab.linkedBrowser;
 
   browser.addEventListener("load", function onLoad() {
@@ -76,17 +76,17 @@ function removeTab(aTab, aWindow) {
 }
 
 function initNetMonitor(aUrl, aWindow) {
   info("Initializing a network monitor pane.");
 
   return addTab(aUrl).then((aTab) => {
     info("Net tab added successfully: " + aUrl);
 
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
     let debuggee = aTab.linkedBrowser.contentWindow.wrappedJSObject;
     let target = TargetFactory.forTab(aTab);
 
     gDevTools.showToolbox(target, "netmonitor").then((aToolbox) => {
       info("Netork monitor pane shown successfully.");
 
       let monitor = aToolbox.getCurrentPanel();
       deferred.resolve([aTab, debuggee, monitor]);
@@ -94,40 +94,40 @@ function initNetMonitor(aUrl, aWindow) {
 
     return deferred.promise;
   });
 }
 
 function restartNetMonitor(aMonitor, aNewUrl) {
   info("Restarting the specified network monitor.");
 
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
   let tab = aMonitor.target.tab;
   let url = aNewUrl || tab.linkedBrowser.contentWindow.wrappedJSObject.location.href;
 
   aMonitor.once("destroyed", () => initNetMonitor(url).then(deferred.resolve));
   removeTab(tab);
 
   return deferred.promise;
 }
 
 function teardown(aMonitor) {
   info("Destroying the specified network monitor.");
 
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
   let tab = aMonitor.target.tab;
 
   aMonitor.once("destroyed", deferred.resolve);
   removeTab(tab);
 
   return deferred.promise;
 }
 
 function waitForNetworkEvents(aMonitor, aGetRequests, aPostRequests = 0) {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   let panel = aMonitor.panelWin;
   let genericEvents = 0;
   let postEvents = 0;
 
   function onGenericEvent() {
     genericEvents++;
     maybeResolve();
--- a/browser/devtools/profiler/commands.js
+++ b/browser/devtools/profiler/commands.js
@@ -5,17 +5,17 @@
 const { Cu } = require("chrome");
 module.exports = [];
 
 Cu.import("resource://gre/modules/devtools/gcli.jsm");
 
 loader.lazyGetter(this, "gDevTools",
   () => Cu.import("resource:///modules/devtools/gDevTools.jsm", {}).gDevTools);
 
-var Promise = require("sdk/core/promise");
+var promise = require("sdk/core/promise");
 
 /*
  * 'profiler' command. Doesn't do anything.
  */
 gcli.addCommand({
   name: "profiler",
   description: gcli.lookup("profilerDesc"),
   manual: gcli.lookup("profilerManual")
@@ -172,9 +172,9 @@ function getPanel(context, id) {
   }
 
   let toolbox = gDevTools.getToolbox(context.environment.target);
   return toolbox == null ? undefined : toolbox.getPanel(id);
 }
 
 function createXHTMLElement(document, tagname) {
   return document.createElementNS("http://www.w3.org/1999/xhtml", tagname);
-}
\ No newline at end of file
+}
--- a/browser/devtools/profiler/panel.js
+++ b/browser/devtools/profiler/panel.js
@@ -8,17 +8,17 @@ const { Cu } = require("chrome");
 const {
   PROFILE_IDLE,
   PROFILE_RUNNING,
   PROFILE_COMPLETED,
   SHOW_PLATFORM_DATA
 } = require("devtools/profiler/consts");
 
 var EventEmitter = require("devtools/shared/event-emitter");
-var Promise      = require("sdk/core/promise");
+var promise      = require("sdk/core/promise");
 var Cleopatra    = require("devtools/profiler/cleopatra");
 var Sidebar      = require("devtools/profiler/sidebar");
 var ProfilerController = require("devtools/profiler/controller");
 
 Cu.import("resource:///modules/devtools/gDevTools.jsm");
 Cu.import("resource://gre/modules/devtools/Console.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
@@ -140,21 +140,21 @@ ProfilerPanel.prototype = {
    * Open a debug connection and, on success, switch to the newly created
    * profile.
    *
    * @return Promise
    */
   open: function PP_open() {
     // Local profiling needs to make the target remote.
     let target = this.target;
-    let promise = !target.isRemote ? target.makeRemote() : Promise.resolve(target);
+    let targetPromise = !target.isRemote ? target.makeRemote() : promise.resolve(target);
 
-    return promise
+    return targetPromise
       .then((target) => {
-        let deferred = Promise.defer();
+        let deferred = promise.defer();
 
         this.controller = new ProfilerController(this.target);
 
         this.sidebar = new Sidebar(this.document.querySelector("#profiles-list"));
         this.sidebar.widget.addEventListener("select", (ev) => {
           if (!ev.detail)
             return;
 
@@ -483,9 +483,9 @@ ProfilerPanel.prototype = {
     this.profiles = null;
     this._uid = null;
     this._activeUid = null;
 
     this.emit("destroyed");
   }
 };
 
-module.exports = ProfilerPanel;
\ No newline at end of file
+module.exports = ProfilerPanel;
--- a/browser/devtools/profiler/test/browser_profiler_bug_855244_multiple_tabs.js
+++ b/browser/devtools/profiler/test/browser_profiler_bug_855244_multiple_tabs.js
@@ -26,17 +26,17 @@ function test() {
     .then(startTwoProfiles)
     .then(closeFirstPanel)
     .then(stopSecondProfile)
     .then(closeTabs)
     .then(finish);
 }
 
 function openTwoTabs() {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   setUp(URL, (tab, browser, panel) => {
     gTab1 = tab;
     gPanel1 = panel;
 
     loadTab(URL, (tab, browser) => {
       gTab2 = tab;
       openProfiler(tab, () => {
@@ -46,45 +46,45 @@ function openTwoTabs() {
       });
     });
   });
 
   return deferred.promise;
 }
 
 function startTwoProfiles() {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
   gPanel1.controller.start("Profile 1", (err) => {
     ok(!err, "Profile in tab 1 started without errors");
     gPanel2.controller.start("Profile 1", (err) => {
       ok(!err, "Profile in tab 2 started without errors");
       gPanel1.controller.isActive((err, isActive) => {
         ok(isActive, "Profiler is active");
         deferred.resolve();
       });
     });
   });
 
   return deferred.promise;
 }
 
 function stopFirstProfile() {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   gPanel1.controller.stop("Profile 1", (err, data) => {
     ok(!err, "Profile in tab 1 stopped without errors");
     ok(data, "Profile in tab 1 returned some data");
     deferred.resolve();
   });
 
   return deferred.promise;
 }
 
 function stopSecondProfile() {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   gPanel2.controller.stop("Profile 1", (err, data) => {
     ok(!err, "Profile in tab 2 stopped without errors");
     ok(data, "Profile in tab 2 returned some data");
     deferred.resolve();
   });
 
   return deferred.promise;
--- a/browser/devtools/profiler/test/browser_profiler_cmd.js
+++ b/browser/devtools/profiler/test/browser_profiler_cmd.js
@@ -26,24 +26,24 @@ function test() {
       .then(testProfilerList)
       .then(testProfilerStop)
       .then(testProfilerClose)
       .then(testProfilerCloseWhenClosed)
   }).then(finishUp);
 }
 
 function setupGlobals() {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
   gPanel = gDevTools.getToolbox(gTarget).getPanel("jsprofiler");
   deferred.resolve();
   return deferred.promise;
 }
 
 function testProfilerStart() {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   gPanel.once("started", function () {
     is(gPanel.profiles.size, 1, "There is a new profile");
     is(gPanel.getProfileByName("Profile 1"), gPanel.recordingProfile, "Recording profile is OK");
     ok(!gPanel.activeProfile, "There's no active profile yet");
     cmd("profiler start", gcli.lookup("profilerAlreadyStarted2"));
     deferred.resolve();
   });
@@ -52,44 +52,44 @@ function testProfilerStart() {
   return deferred.promise;
 }
 
 function testProfilerList() {
   cmd("profiler list", /^.*Profile\s1\s\*.*$/);
 }
 
 function testProfilerStop() {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   gPanel.once("stopped", function () {
     is(gPanel.activeProfile, gPanel.getProfileByName("Profile 1"), "Active profile is OK");
     ok(!gPanel.recordingProfile, "There's no recording profile");
     cmd("profiler stop", gcli.lookup("profilerNotStarted3"));
     deferred.resolve();
   });
 
   cmd("profiler stop");
   return deferred.promise;
 }
 
 function testProfilerShow() {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   gPanel.once("profileSwitched", function () {
     is(gPanel.getProfileByName("Profile 1"), gPanel.activeProfile, "Profile 1 is active");
     cmd('profile show "invalid"', gcli.lookup("profilerNotFound"));
     deferred.resolve();
   });
 
   cmd('profile show "Profile 1"');
   return deferred.promise;
 }
 
 function testProfilerClose() {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   helpers.audit(gOptions, [{
     setup: "profiler close",
     completed: false,
     exec: { output: "" }
   }]);
 
   let toolbox = gDevTools.getToolbox(gOptions.target);
@@ -106,17 +106,17 @@ function testProfilerClose() {
   return deferred.promise;
 }
 
 function testProfilerCloseWhenClosed() {
   // We need to call this test to make sure there are no
   // errors when executing 'profiler close' on a closed
   // toolbox. See bug 863636 for more info.
 
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   helpers.audit(gOptions, [{
     setup: "profiler close",
     completed: false,
     exec: { output: "" }
   }]);
 
   let toolbox = gDevTools.getToolbox(gOptions.target);
@@ -133,9 +133,9 @@ function testProfilerCloseWhenClosed() {
   return deferred.promise;
 }
 
 function finishUp() {
   gTarget = null;
   gPanel = null;
   gOptions = null;
   finish();
-}
\ No newline at end of file
+}
--- a/browser/devtools/profiler/test/browser_profiler_gecko_data.js
+++ b/browser/devtools/profiler/test/browser_profiler_gecko_data.js
@@ -20,17 +20,17 @@ function test() {
     recordProfile()
       .then(toggleGeckoDataOption)
       .then(recordProfile)
       .then(done);
   });
 }
 
 function recordProfile() {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
   let record = gPanel.controls.record;
 
   gPanel.once("started", () => {
     gPanel.once("parsed", () => {
       // We cannot be sure which data is returned by
       // the profiler within a test. Until we get rid
       // of Cleopatra, at least.
       deferred.resolve();
@@ -44,9 +44,9 @@ function recordProfile() {
 }
 
 function toggleGeckoDataOption() {
   ok(!gPanel.showPlatformData, "showPlatformData is not set");
 
   Services.prefs.setBoolPref(SHOW_PLATFORM_DATA, true);
 
   ok(gPanel.showPlatformData, "showPlatformData is set");
-}
\ No newline at end of file
+}
--- a/browser/devtools/profiler/test/browser_profiler_run.js
+++ b/browser/devtools/profiler/test/browser_profiler_run.js
@@ -21,17 +21,17 @@ function test() {
       .then(startRecordingAgain)
       .then(stopRecording)
       .then(switchBackToTheFirstOne)
       .then(done);
   });
 }
 
 function startRecording() {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   ok(gPanel, "Profiler panel exists");
   ok(!gPanel.activeProfile, "Active profile doesn't exist");
   ok(!gPanel.recordingProfile, "Recording profile doesn't exist");
 
   let record = gPanel.controls.record;
   ok(record, "Record button exists.");
   ok(!record.getAttribute("checked"), "Record button is unchecked");
@@ -47,17 +47,17 @@ function startRecording() {
     });
   });
 
   record.click();
   return deferred.promise;
 }
 
 function stopRecording() {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   gPanel.once("parsed", () => {
     let item = gPanel.sidebar.getItemByProfile(gPanel.activeProfile);
     is(item.attachment.state, PROFILE_COMPLETED);
 
     function assertSample() {
       let [ win, doc ] = getProfileInternals();
       let sample = doc.getElementsByClassName("samplePercentage");
@@ -75,17 +75,17 @@ function stopRecording() {
     assertSample();
   });
 
   setTimeout(function () gPanel.controls.record.click(), 100);
   return deferred.promise;
 }
 
 function startRecordingAgain() {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   let record = gPanel.controls.record;
   ok(!record.getAttribute("checked"), "Record button is unchecked");
 
   gPanel.once("started", () => {
     ok(gPanel.activeProfile !== gPanel.recordingProfile);
 
     let item = gPanel.sidebar.getItemByProfile(gPanel.recordingProfile);
@@ -95,21 +95,21 @@ function startRecordingAgain() {
     deferred.resolve();
   });
 
   record.click();
   return deferred.promise;
 }
 
 function switchBackToTheFirstOne() {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
   let button = gPanel.sidebar.getElementByProfile({ uid: 1 });
   let item = gPanel.sidebar.getItemByProfile({ uid: 1 });
 
   gPanel.once("profileSwitched", () => {
     is(gPanel.activeProfile.uid, 1, "activeProfile is correct");
     is(gPanel.sidebar.selectedItem, item, "selectedItem is correct");
     deferred.resolve();
   });
 
   button.click();
   return deferred.promise;
-}
\ No newline at end of file
+}
--- a/browser/devtools/scratchpad/scratchpad.js
+++ b/browser/devtools/scratchpad/scratchpad.js
@@ -22,17 +22,17 @@ Cu.import("resource://gre/modules/XPCOMU
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/NetUtil.jsm");
 Cu.import("resource:///modules/source-editor.jsm");
 Cu.import("resource:///modules/devtools/LayoutHelpers.jsm");
 Cu.import("resource:///modules/devtools/scratchpad-manager.jsm");
 Cu.import("resource://gre/modules/jsdebugger.jsm");
 Cu.import("resource:///modules/devtools/gDevTools.jsm");
 Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
+let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js").Promise;
 
 XPCOMUtils.defineLazyModuleGetter(this, "VariablesView",
                                   "resource:///modules/devtools/VariablesView.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "devtools",
                                   "resource://gre/modules/devtools/Loader.jsm");
 
 let Telemetry = devtools.require("devtools/shared/telemetry");
@@ -384,17 +384,17 @@ var Scratchpad = {
    *
    * @param string aString
    *        The script you want to evaluate.
    * @return Promise
    *         The promise for the script evaluation result.
    */
   evalForContext: function SP_evaluateForContext(aString)
   {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     // This setTimeout is temporary and will be replaced by DebuggerClient
     // execution in a future patch (bug 825039). The purpose for using
     // setTimeout is to ensure there is no accidental dependency on the
     // promise being resolved synchronously, which can cause subtle bugs.
     setTimeout(() => {
       let chrome = this.executionContext != SCRATCHPAD_CONTEXT_CONTENT;
       let sandbox = chrome ? this.chromeSandbox : this.contentSandbox;
@@ -429,39 +429,39 @@ var Scratchpad = {
    * Execute the selected text (if any) or the entire editor content in the
    * current context.
    *
    * @return Promise
    *         The promise for the script evaluation result.
    */
   run: function SP_run()
   {
-    let promise = this.execute();
-    promise.then(([, aError, ]) => {
+    let execPromise = this.execute();
+    execPromise.then(([, aError, ]) => {
       if (aError) {
         this.writeAsErrorComment(aError);
       }
       else {
         this.deselect();
       }
     });
-    return promise;
+    return execPromise;
   },
 
   /**
    * Execute the selected text (if any) or the entire editor content in the
    * current context. If the result is primitive then it is written as a
    * comment. Otherwise, the resulting object is inspected up in the sidebar.
    *
    * @return Promise
    *         The promise for the script evaluation result.
    */
   inspect: function SP_inspect()
   {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
     let reject = aReason => deferred.reject(aReason);
 
     this.execute().then(([aString, aError, aResult]) => {
       let resolve = () => deferred.resolve([aString, aError, aResult]);
 
       if (aError) {
         this.writeAsErrorComment(aError);
         resolve();
@@ -484,17 +484,17 @@ var Scratchpad = {
    * the page finishes loading. Note that this operation should be available
    * only in the content context.
    *
    * @return Promise
    *         The promise for the script evaluation result.
    */
   reloadAndRun: function SP_reloadAndRun()
   {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     if (this.executionContext !== SCRATCHPAD_CONTEXT_CONTENT) {
       Cu.reportError(this.strings.
           GetStringFromName("scratchpadContext.invalid"));
       return;
     }
 
     let browser = this.gBrowser.selectedBrowser;
@@ -521,26 +521,26 @@ var Scratchpad = {
    * the selected text, or at the end of the editor content if there is no
    * selected text.
    *
    * @return Promise
    *         The promise for the script evaluation result.
    */
   display: function SP_display()
   {
-    let promise = this.execute();
-    promise.then(([aString, aError, aResult]) => {
+    let execPromise = this.execute();
+    execPromise.then(([aString, aError, aResult]) => {
       if (aError) {
         this.writeAsErrorComment(aError);
       }
       else {
         this.writeAsComment(aResult);
       }
     });
-    return promise;
+    return execPromise;
   },
 
   /**
    * Write out a value at the next line from the current insertion point.
    * The comment block will always be preceded by a newline character.
    * @param object aValue
    *        The Object to write out as a string
    */
@@ -620,18 +620,18 @@ var Scratchpad = {
     if (!aNoConfirmation && aFile.exists() &&
         !window.confirm(this.strings.
                         GetStringFromName("export.fileOverwriteConfirmation"))) {
       return;
     }
 
     let encoder = new TextEncoder();
     let buffer = encoder.encode(this.getText());
-    let promise = OS.File.writeAtomic(aFile.path, buffer,{tmpPath: aFile.path + ".tmp"});
-    promise.then(value => {
+    let writePromise = OS.File.writeAtomic(aFile.path, buffer,{tmpPath: aFile.path + ".tmp"});
+    writePromise.then(value => {
       if (aCallback) {
         aCallback.call(this, Components.results.NS_OK);
       }
     }, reason => {
       if (!aSilentError) {
         window.alert(this.strings.GetStringFromName("saveFile.failed"));
       }
       if (aCallback) {
@@ -1518,17 +1518,17 @@ ScratchpadSidebar.prototype = {
    *        The object to inspect, which is the aEvalString evaluation result.
    * @return Promise
    *         A promise that will resolve once the sidebar is open.
    */
   open: function SS_open(aEvalString, aObject)
   {
     this.show();
 
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     let onTabReady = () => {
       if (!this.variablesView) {
         let window = this._sidebar.getWindowForTab("variablesview");
         let container = window.document.querySelector("#variables");
         this.variablesView = new VariablesView(container, {
           searchEnabled: true,
           searchPlaceholder: this._scratchpad.strings
@@ -1576,17 +1576,17 @@ ScratchpadSidebar.prototype = {
    *
    * @param object aObject
    *        The object to inspect in the sidebar.
    * @return Promise
    *         A promise that resolves when the update completes.
    */
   _update: function SS__update(aObject)
   {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     this.variablesView.rawObject = aObject;
 
     // In the future this will work on remote values (bug 825039).
     setTimeout(() => deferred.resolve(), 0);
     return deferred.promise;
   }
 };
--- a/browser/devtools/scratchpad/test/head.js
+++ b/browser/devtools/scratchpad/test/head.js
@@ -8,17 +8,17 @@ let tempScope = {};
 
 Cu.import("resource://gre/modules/NetUtil.jsm", tempScope);
 Cu.import("resource://gre/modules/FileUtils.jsm", tempScope);
 Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", tempScope);
 
 
 let NetUtil = tempScope.NetUtil;
 let FileUtils = tempScope.FileUtils;
-let Promise = tempScope.Promise;
+let promise = tempScope.Promise;
 
 let gScratchpadWindow; // Reference to the Scratchpad chrome window object
 
 /**
  * Open a Scratchpad window.
  *
  * @param function aReadyCallback
  *        Optional. The function you want invoked when the Scratchpad instance
@@ -122,17 +122,17 @@ function createTempFile(aName, aContent,
  *          Expected code that will be in the scratchpad upon completion.
  *        - label
  *          The tests label which will be logged in the test runner output.
  * @return Promise
  *         The promise that will be resolved when all tests are finished.
  */
 function runAsyncTests(aScratchpad, aTests)
 {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   (function runTest() {
     if (aTests.length) {
       let test = aTests.shift();
       aScratchpad.setText(test.code);
       aScratchpad[test.method]().then(function success() {
         is(aScratchpad.getText(), test.result, test.label);
         runTest();
@@ -162,17 +162,17 @@ function runAsyncTests(aScratchpad, aTes
  *          The callback to run just prior to executing the scratchpad method.
  *        - then
  *          The callback to run when the scratchpad execution promise resolves.
  * @return Promise
  *         The promise that will be resolved when all tests are finished.
  */
 function runAsyncCallbackTests(aScratchpad, aTests)
 {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   (function runTest() {
     if (aTests.length) {
       let test = aTests.shift();
       test.prepare();
       aScratchpad[test.method]().then(test.then.bind(test)).then(runTest);
     } else {
       deferred.resolve();
--- a/browser/devtools/shared/AppCacheUtils.jsm
+++ b/browser/devtools/shared/AppCacheUtils.jsm
@@ -24,17 +24,17 @@
  */
 
 "use strict";
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
 let { Services }   = Cu.import("resource://gre/modules/Services.jsm", {});
-let { Promise }    = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
+let { Promise: promise }    = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
 
 this.EXPORTED_SYMBOLS = ["AppCacheUtils"];
 
 function AppCacheUtils(documentOrUri) {
   this._parseManifest = this._parseManifest.bind(this);
 
   if (documentOrUri) {
     if (typeof documentOrUri == "string") {
@@ -47,17 +47,17 @@ function AppCacheUtils(documentOrUri) {
 }
 
 AppCacheUtils.prototype = {
   get cachePath() {
     return "";
   },
 
   validateManifest: function ACU_validateManifest() {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
     this.errors = [];
     // Check for missing manifest.
     this._getManifestURI().then(manifestURI => {
       this.manifestURI = manifestURI;
 
       if (!this.manifestURI) {
         this._addError(0, "noManifest");
         deferred.resolve(this.errors);
@@ -73,17 +73,17 @@ AppCacheUtils.prototype = {
         });
       });
     });
 
     return deferred.promise;
   },
 
   _parseManifest: function ACU__parseManifest(uriInfo) {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
     let manifestName = uriInfo.name;
     let manifestLastModified = new Date(uriInfo.responseHeaders["Last-Modified"]);
 
     if (uriInfo.charset.toLowerCase() != "utf-8") {
       this._addError(0, "notUTF8", uriInfo.charset);
     }
 
     if (uriInfo.mimeType != "text/cache-manifest") {
@@ -176,17 +176,17 @@ AppCacheUtils.prototype = {
     }
 
     return deferred.promise;
   },
 
   _getURIInfo: function ACU__getURIInfo(uri) {
     let inputStream = Cc["@mozilla.org/scriptableinputstream;1"]
                         .createInstance(Ci.nsIScriptableInputStream);
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
     let channelCharset = "";
     let buffer = "";
     let channel = Services.io.newChannel(uri, null, null);
 
     // Avoid the cache:
     channel.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;
     channel.loadFlags |= Ci.nsIRequest.INHIBIT_CACHING;
 
@@ -313,30 +313,30 @@ AppCacheUtils.prototype = {
     }
   },
 
   clearAll: function ACU_clearAll() {
     Services.cache.evictEntries(Ci.nsICache.STORE_OFFLINE);
   },
 
   _getManifestURI: function ACU__getManifestURI() {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     let getURI = node => {
       let htmlNode = this.doc.querySelector("html[manifest]");
       if (htmlNode) {
         let pageUri = this.doc.location ? this.doc.location.href : this.uri;
         let origin = pageUri.substr(0, pageUri.lastIndexOf("/") + 1);
         return origin + htmlNode.getAttribute("manifest");
       }
     };
 
     if (this.doc) {
       let uri = getURI(this.doc);
-      return Promise.resolve(uri);
+      return promise.resolve(uri);
     } else {
       this._getURIInfo(this.uri).then(uriInfo => {
         if (uriInfo.success) {
           let html = uriInfo.text;
           let parser = _DOMParser;
           this.doc = parser.parseFromString(html, "text/html");
           let uri = getURI(this.doc);
           deferred.resolve(uri);
--- a/browser/devtools/shared/test/browser_telemetry_buttonsandsidebar.js
+++ b/browser/devtools/shared/test/browser_telemetry_buttonsandsidebar.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_buttonsandsidebar.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
-let {Promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
+let {Promise: promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
 let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
 
 let require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
 let Telemetry = require("devtools/shared/telemetry");
 
 function init() {
   Telemetry.prototype.telemetryInfo = {};
   Telemetry.prototype._oldlog = Telemetry.prototype.log;
@@ -63,17 +63,17 @@ function testButtons() {
           }
         });
       }
     })();
   }).then(null, reportError);
 }
 
 function delayedClicks(node, clicks) {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
   let clicked = 0;
 
   setTimeout(function delayedClick() {
     info("Clicking button " + node.id);
     node.click();
     clicked++;
 
     if (clicked >= clicks) {
@@ -157,17 +157,17 @@ function reportError(error) {
 
 function finishUp() {
   gBrowser.removeCurrentTab();
 
   Telemetry.prototype.log = Telemetry.prototype._oldlog;
   delete Telemetry.prototype._oldlog;
   delete Telemetry.prototype.telemetryInfo;
 
-  TargetFactory = Services = Promise = require = null;
+  TargetFactory = Services = promise = require = null;
 
   finish();
 }
 
 function test() {
   waitForExplicitFinish();
   gBrowser.selectedTab = gBrowser.addTab();
   gBrowser.selectedBrowser.addEventListener("load", function() {
--- a/browser/devtools/shared/test/browser_telemetry_toolboxtabs_inspector.js
+++ b/browser/devtools/shared/test/browser_telemetry_toolboxtabs_inspector.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_inspector.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
-let {Promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
+let {Promise: promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
 let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
 
 let require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
 let Telemetry = require("devtools/shared/telemetry");
 
 function init() {
   Telemetry.prototype.telemetryInfo = {};
   Telemetry.prototype._oldlog = Telemetry.prototype.log;
@@ -88,17 +88,17 @@ function reportError(error) {
 
 function finishUp() {
   gBrowser.removeCurrentTab();
 
   Telemetry.prototype.log = Telemetry.prototype._oldlog;
   delete Telemetry.prototype._oldlog;
   delete Telemetry.prototype.telemetryInfo;
 
-  TargetFactory = Services = Promise = require = null;
+  TargetFactory = Services = promise = require = null;
 
   finish();
 }
 
 function test() {
   waitForExplicitFinish();
   gBrowser.selectedTab = gBrowser.addTab();
   gBrowser.selectedBrowser.addEventListener("load", function() {
--- a/browser/devtools/shared/test/browser_telemetry_toolboxtabs_jsdebugger.js
+++ b/browser/devtools/shared/test/browser_telemetry_toolboxtabs_jsdebugger.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_jsdebugger.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
-let {Promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
+let {Promise: promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
 let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
 
 let require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
 let Telemetry = require("devtools/shared/telemetry");
 
 function init() {
   Telemetry.prototype.telemetryInfo = {};
   Telemetry.prototype._oldlog = Telemetry.prototype.log;
@@ -88,17 +88,17 @@ function reportError(error) {
 
 function finishUp() {
   gBrowser.removeCurrentTab();
 
   Telemetry.prototype.log = Telemetry.prototype._oldlog;
   delete Telemetry.prototype._oldlog;
   delete Telemetry.prototype.telemetryInfo;
 
-  TargetFactory = Services = Promise = require = null;
+  TargetFactory = Services = promise = require = null;
 
   finish();
 }
 
 function test() {
   waitForExplicitFinish();
   gBrowser.selectedTab = gBrowser.addTab();
   gBrowser.selectedBrowser.addEventListener("load", function() {
--- a/browser/devtools/shared/test/browser_telemetry_toolboxtabs_jsprofiler.js
+++ b/browser/devtools/shared/test/browser_telemetry_toolboxtabs_jsprofiler.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_jsprofiler.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
-let {Promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
+let {Promise: promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
 let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
 
 let require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
 let Telemetry = require("devtools/shared/telemetry");
 
 function init() {
   Telemetry.prototype.telemetryInfo = {};
   Telemetry.prototype._oldlog = Telemetry.prototype.log;
@@ -88,17 +88,17 @@ function reportError(error) {
 
 function finishUp() {
   gBrowser.removeCurrentTab();
 
   Telemetry.prototype.log = Telemetry.prototype._oldlog;
   delete Telemetry.prototype._oldlog;
   delete Telemetry.prototype.telemetryInfo;
 
-  TargetFactory = Services = Promise = require = null;
+  TargetFactory = Services = promise = require = null;
 
   finish();
 }
 
 function test() {
   waitForExplicitFinish();
   gBrowser.selectedTab = gBrowser.addTab();
   gBrowser.selectedBrowser.addEventListener("load", function() {
--- a/browser/devtools/shared/test/browser_telemetry_toolboxtabs_netmonitor.js
+++ b/browser/devtools/shared/test/browser_telemetry_toolboxtabs_netmonitor.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_netmonitor.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
-let {Promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
+let {Promise: promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
 let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
 
 let require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
 let Telemetry = require("devtools/shared/telemetry");
 
 function init() {
   Telemetry.prototype.telemetryInfo = {};
   Telemetry.prototype._oldlog = Telemetry.prototype.log;
@@ -88,17 +88,17 @@ function reportError(error) {
 
 function finishUp() {
   gBrowser.removeCurrentTab();
 
   Telemetry.prototype.log = Telemetry.prototype._oldlog;
   delete Telemetry.prototype._oldlog;
   delete Telemetry.prototype.telemetryInfo;
 
-  TargetFactory = Services = Promise = require = null;
+  TargetFactory = Services = promise = require = null;
 
   finish();
 }
 
 function test() {
   waitForExplicitFinish();
   gBrowser.selectedTab = gBrowser.addTab();
   gBrowser.selectedBrowser.addEventListener("load", function() {
--- a/browser/devtools/shared/test/browser_telemetry_toolboxtabs_options.js
+++ b/browser/devtools/shared/test/browser_telemetry_toolboxtabs_options.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_options.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
-let {Promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
+let {Promise: promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
 let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
 
 let require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
 let Telemetry = require("devtools/shared/telemetry");
 
 function init() {
   Telemetry.prototype.telemetryInfo = {};
   Telemetry.prototype._oldlog = Telemetry.prototype.log;
@@ -88,17 +88,17 @@ function reportError(error) {
 
 function finishUp() {
   gBrowser.removeCurrentTab();
 
   Telemetry.prototype.log = Telemetry.prototype._oldlog;
   delete Telemetry.prototype._oldlog;
   delete Telemetry.prototype.telemetryInfo;
 
-  TargetFactory = Services = Promise = require = null;
+  TargetFactory = Services = promise = require = null;
 
   finish();
 }
 
 function test() {
   waitForExplicitFinish();
   gBrowser.selectedTab = gBrowser.addTab();
   gBrowser.selectedBrowser.addEventListener("load", function() {
--- a/browser/devtools/shared/test/browser_telemetry_toolboxtabs_styleeditor.js
+++ b/browser/devtools/shared/test/browser_telemetry_toolboxtabs_styleeditor.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_styleeditor.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
-let {Promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
+let {Promise: promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
 let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
 
 let require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
 let Telemetry = require("devtools/shared/telemetry");
 
 function init() {
   Telemetry.prototype.telemetryInfo = {};
   Telemetry.prototype._oldlog = Telemetry.prototype.log;
@@ -88,17 +88,17 @@ function reportError(error) {
 
 function finishUp() {
   gBrowser.removeCurrentTab();
 
   Telemetry.prototype.log = Telemetry.prototype._oldlog;
   delete Telemetry.prototype._oldlog;
   delete Telemetry.prototype.telemetryInfo;
 
-  TargetFactory = Services = Promise = require = null;
+  TargetFactory = Services = promise = require = null;
 
   finish();
 }
 
 function test() {
   waitForExplicitFinish();
   gBrowser.selectedTab = gBrowser.addTab();
   gBrowser.selectedBrowser.addEventListener("load", function() {
--- a/browser/devtools/shared/test/browser_telemetry_toolboxtabs_webconsole.js
+++ b/browser/devtools/shared/test/browser_telemetry_toolboxtabs_webconsole.js
@@ -2,17 +2,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 
 const TEST_URI = "data:text/html;charset=utf-8,<p>browser_telemetry_toolboxtabs_styleeditor_webconsole.js</p>";
 
 // Because we need to gather stats for the period of time that a tool has been
 // opened we make use of setTimeout() to create tool active times.
 const TOOL_DELAY = 200;
 
-let {Promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
+let {Promise: promise} = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {});
 let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
 
 let require = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools.require;
 let Telemetry = require("devtools/shared/telemetry");
 
 function init() {
   Telemetry.prototype.telemetryInfo = {};
   Telemetry.prototype._oldlog = Telemetry.prototype.log;
@@ -88,17 +88,17 @@ function reportError(error) {
 
 function finishUp() {
   gBrowser.removeCurrentTab();
 
   Telemetry.prototype.log = Telemetry.prototype._oldlog;
   delete Telemetry.prototype._oldlog;
   delete Telemetry.prototype.telemetryInfo;
 
-  TargetFactory = Services = Promise = require = null;
+  TargetFactory = Services = promise = require = null;
 
   finish();
 }
 
 function test() {
   waitForExplicitFinish();
   gBrowser.selectedTab = gBrowser.addTab();
   gBrowser.selectedBrowser.addEventListener("load", function() {
--- a/browser/devtools/shared/test/browser_templater_basic.js
+++ b/browser/devtools/shared/test/browser_templater_basic.js
@@ -4,17 +4,17 @@
 // Tests that the DOM Template engine works properly
 
 /*
  * These tests run both in Mozilla/Mochitest and plain browsers (as does
  * domtemplate)
  * We should endevour to keep the source in sync.
  */
 
-var Promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {}).Promise;
+var promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {}).Promise;
 var template = Cu.import("resource://gre/modules/devtools/Templater.jsm", {}).template;
 
 const TEST_URI = "http://example.com/browser/browser/devtools/shared/test/browser_templater_basic.html";
 
 function test() {
   addTab(TEST_URI, function() {
     info("Starting DOM Templater Tests");
     runTest(0);
@@ -275,14 +275,14 @@ var tests = [
     template: '<div><p value="${nullvar}"></p><p value="${undefinedvar1}"></p><p value="${undefinedvar2}"></p></div>',
     data: { nullvar: null, undefinedvar1: undefined },
     options: { blankNullUndefined: true },
     result: '<div><p value=""></p><p value=""></p><p value=""></p></div>'
   };}
 ];
 
 function delayReply(data) {
-  var d = Promise.defer();
+  var d = promise.defer();
   executeSoon(function() {
     d.resolve(data);
   });
   return d.promise;
 }
--- a/browser/devtools/shared/widgets/VariablesView.jsm
+++ b/browser/devtools/shared/widgets/VariablesView.jsm
@@ -16,17 +16,17 @@ const LAZY_APPEND_BATCH = 100; // nodes
 const PAGE_SIZE_SCROLL_HEIGHT_RATIO = 100;
 const PAGE_SIZE_MAX_JUMPS = 30;
 const SEARCH_ACTION_MAX_DELAY = 300; // ms
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource:///modules/devtools/ViewHelpers.jsm");
 Cu.import("resource:///modules/devtools/shared/event-emitter.js");
-Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
+let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js").Promise;
 
 XPCOMUtils.defineLazyModuleGetter(this, "NetworkHelper",
   "resource://gre/modules/devtools/NetworkHelper.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "WebConsoleUtils",
   "resource://gre/modules/devtools/WebConsoleUtils.jsm");
 
 this.EXPORTED_SYMBOLS = ["VariablesView"];
--- a/browser/devtools/shared/widgets/VariablesViewController.jsm
+++ b/browser/devtools/shared/widgets/VariablesViewController.jsm
@@ -4,17 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
+let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js").Promise;
 Cu.import("resource:///modules/devtools/VariablesView.jsm");
 Cu.import("resource:///modules/devtools/ViewHelpers.jsm");
 Cu.import("resource://gre/modules/devtools/WebConsoleUtils.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "VARIABLES_SORTING_ENABLED", () =>
   Services.prefs.getBoolPref("devtools.debugger.ui.variables-sorting-enabled")
 );
 
@@ -83,17 +83,17 @@ VariablesViewController.prototype = {
    * @param Variable aTarget
    *        The target Variable/Property to put the retrieved string into.
    * @param LongStringActor aGrip
    *        The long string grip that use to retrieve the full string.
    * @return Promise
    *         The promise that will be resolved when the string is retrieved.
    */
   _populateFromLongString: function(aTarget, aGrip){
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     let from = aGrip.initial.length;
     let to = Math.min(aGrip.length, MAX_LONG_STRING_LENGTH);
 
     this._getLongStringClient(aGrip).substring(from, to, aResponse => {
       // Stop tracking the actor because it's no longer needed.
       this.releaseActor(aGrip);
 
@@ -115,17 +115,17 @@ VariablesViewController.prototype = {
    * when a scope is expanded or certain variables are hovered.
    *
    * @param Scope aTarget
    *        The Scope where the properties will be placed into.
    * @param object aGrip
    *        The grip to use to populate the target.
    */
   _populateFromObject: function(aTarget, aGrip) {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     this._getGripClient(aGrip).getPrototypeAndProperties(aResponse => {
       let { ownProperties, prototype } = aResponse;
       // safeGetterValues is new and isn't necessary defined on old actors
       let safeGetterValues = aResponse.safeGetterValues || {};
       let sortable = VariablesView.isSortable(aGrip.class);
 
       // Merge the safe getter values into one object such that we can use it
@@ -232,17 +232,17 @@ VariablesViewController.prototype = {
    *         The promise that is resolved once the target has been expanded.
    */
   expand: function(aTarget, aSource) {
     // Fetch the variables only once.
     if (aTarget._fetched) {
       return aTarget._fetched;
     }
 
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
     aTarget._fetched = deferred.promise;
 
     if (!aSource) {
       throw new Error("No actor grip was given for the variable.");
     }
 
     // If the target a Variable or Property then we're fetching properties
     if (VariablesView.isVariable(aTarget)) {
--- a/browser/devtools/styleeditor/StyleEditorDebuggee.jsm
+++ b/browser/devtools/styleeditor/StyleEditorDebuggee.jsm
@@ -9,18 +9,18 @@ this.EXPORTED_SYMBOLS = ["StyleEditorDeb
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource:///modules/devtools/shared/event-emitter.js");
 
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-    "resource://gre/modules/commonjs/sdk/core/promise.js");
+XPCOMUtils.defineLazyModuleGetter(this, "promise",
+    "resource://gre/modules/commonjs/sdk/core/promise.js", "Promise");
 
 /**
  * A StyleEditorDebuggee represents the document the style editor is debugging.
  * It maintains a list of StyleSheet objects that represent the stylesheets in
  * the target's document. It wraps remote debugging protocol comunications.
  *
  * It emits these events:
  *   'document-load': debuggee's document is loaded, style sheets are argument
--- a/browser/devtools/styleeditor/StyleEditorPanel.jsm
+++ b/browser/devtools/styleeditor/StyleEditorPanel.jsm
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 this.EXPORTED_SYMBOLS = ["StyleEditorPanel"];
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
+let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js").Promise;
 Cu.import("resource:///modules/devtools/shared/event-emitter.js");
 Cu.import("resource:///modules/devtools/StyleEditorDebuggee.jsm");
 Cu.import("resource:///modules/devtools/StyleEditorUI.jsm");
 Cu.import("resource:///modules/devtools/StyleEditorUtil.jsm");
 
 
 XPCOMUtils.defineLazyModuleGetter(this, "StyleEditorChrome",
                         "resource:///modules/devtools/StyleEditorChrome.jsm");
@@ -36,27 +36,27 @@ StyleEditorPanel.prototype = {
   get target() this._toolbox.target,
 
   get panelWindow() this._panelWin,
 
   /**
    * open is effectively an asynchronous constructor
    */
   open: function() {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
-    let promise;
+    let targetPromise;
     // We always interact with the target as if it were remote
     if (!this.target.isRemote) {
-      promise = this.target.makeRemote();
+      targetPromise = this.target.makeRemote();
     } else {
-      promise = Promise.resolve(this.target);
+      targetPromise = promise.resolve(this.target);
     }
 
-    promise.then(() => {
+    targetPromise.then(() => {
       this.target.on("close", this.destroy);
 
       this._debuggee = new StyleEditorDebuggee(this.target);
 
       this.UI = new StyleEditorUI(this._debuggee, this._panelDoc);
       this.UI.on("error", this._showError);
 
       this.isReady = true;
@@ -114,17 +114,17 @@ StyleEditorPanel.prototype = {
       this._target = null;
       this._toolbox = null;
       this._panelDoc = null;
 
       this._debuggee.destroy();
       this.UI.destroy();
     }
 
-    return Promise.resolve(null);
+    return promise.resolve(null);
   },
 }
 
 XPCOMUtils.defineLazyGetter(StyleEditorPanel.prototype, "strings",
   function () {
     return Services.strings.createBundle(
             "chrome://browser/locale/devtools/styleeditor.properties");
   });
--- a/browser/devtools/styleeditor/StyleEditorUI.jsm
+++ b/browser/devtools/styleeditor/StyleEditorUI.jsm
@@ -9,17 +9,17 @@ this.EXPORTED_SYMBOLS = ["StyleEditorUI"
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/PluralForm.jsm");
 Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
+let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js").Promise;
 Cu.import("resource:///modules/devtools/shared/event-emitter.js");
 Cu.import("resource:///modules/devtools/StyleEditorUtil.jsm");
 Cu.import("resource:///modules/devtools/SplitView.jsm");
 Cu.import("resource:///modules/devtools/StyleSheetEditor.jsm");
 
 
 const LOAD_ERROR = "error-load";
 
--- a/browser/devtools/styleeditor/StyleSheetEditor.jsm
+++ b/browser/devtools/styleeditor/StyleSheetEditor.jsm
@@ -6,17 +6,17 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["StyleSheetEditor"];
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
-Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
+let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js").Promise;
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/FileUtils.jsm");
 Cu.import("resource://gre/modules/NetUtil.jsm");
 Cu.import("resource:///modules/devtools/shared/event-emitter.js");
 Cu.import("resource:///modules/source-editor.jsm");
 Cu.import("resource:///modules/devtools/StyleEditorUtil.jsm");
 
 
@@ -236,20 +236,20 @@ StyleSheetEditor.prototype = {
 
   /**
    * Get the source editor for this editor.
    *
    * @return {Promise}
    *         Promise that will resolve with the editor.
    */
   getSourceEditor: function() {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     if (this.sourceEditor) {
-      return Promise.resolve(this);
+      return promise.resolve(this);
     }
     this.on("source-editor-load", (event) => {
       deferred.resolve(this);
     });
     return deferred.promise;
   },
 
   /**
--- a/browser/devtools/styleeditor/test/browser_styleeditor_cmd_edit.js
+++ b/browser/devtools/styleeditor/test/browser_styleeditor_cmd_edit.js
@@ -3,17 +3,17 @@
 
 // Tests that the edit command works
 
 const TEST_URI = "http://example.com/browser/browser/devtools/styleeditor/" +
                  "test/browser_styleeditor_cmd_edit.html";
 
 
 function test() {
-  let windowClosed = Promise.defer();
+  let windowClosed = promise.defer();
 
   helpers.addTabWithToolbar(TEST_URI, function(options) {
     return helpers.audit(options, [
       {
         setup: "edit",
         check: {
           input:  'edit',
           hints:      ' <resource> [line]',
--- a/browser/devtools/webconsole/HUDService.jsm
+++ b/browser/devtools/webconsole/HUDService.jsm
@@ -25,18 +25,18 @@ XPCOMUtils.defineLazyModuleGetter(this, 
   "resource://gre/modules/devtools/dbg-server.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "DebuggerClient",
   "resource://gre/modules/devtools/dbg-client.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "WebConsoleUtils",
     "resource://gre/modules/devtools/WebConsoleUtils.jsm");
 
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-    "resource://gre/modules/commonjs/sdk/core/promise.js");
+XPCOMUtils.defineLazyModuleGetter(this, "promise",
+    "resource://gre/modules/commonjs/sdk/core/promise.js", "Promise");
 
 XPCOMUtils.defineLazyModuleGetter(this, "Heritage",
     "resource:///modules/devtools/ViewHelpers.jsm");
 
 let Telemetry = devtools.require("devtools/shared/telemetry");
 
 const STRINGS_URI = "chrome://browser/locale/devtools/webconsole.properties";
 let l10n = new WebConsoleUtils.l10n(STRINGS_URI);
@@ -89,17 +89,17 @@ HUD_SERVICE.prototype =
    *
    * @param object aTarget
    *        The target that the web console will connect to.
    * @param nsIDOMWindow aIframeWindow
    *        The window where the web console UI is already loaded.
    * @param nsIDOMWindow aChromeWindow
    *        The window of the web console owner.
    * @return object
-   *         A Promise object for the opening of the new WebConsole instance.
+   *         A promise object for the opening of the new WebConsole instance.
    */
   openWebConsole:
   function HS_openWebConsole(aTarget, aIframeWindow, aChromeWindow)
   {
     let hud = new WebConsole(aTarget, aIframeWindow, aChromeWindow);
     this.hudReferences[hud.hudId] = hud;
     return hud.init();
   },
@@ -111,17 +111,17 @@ HUD_SERVICE.prototype =
    *
    * @param object aTarget
    *        The target that the browser console will connect to.
    * @param nsIDOMWindow aIframeWindow
    *        The window where the browser console UI is already loaded.
    * @param nsIDOMWindow aChromeWindow
    *        The window of the browser console owner.
    * @return object
-   *         A Promise object for the opening of the new BrowserConsole instance.
+   *         A promise object for the opening of the new BrowserConsole instance.
    */
   openBrowserConsole:
   function HS_openBrowserConsole(aTarget, aIframeWindow, aChromeWindow)
   {
     let hud = new BrowserConsole(aTarget, aIframeWindow, aChromeWindow);
     this.hudReferences[hud.hudId] = hud;
     return hud.init();
   },
@@ -249,17 +249,17 @@ WebConsole.prototype = {
   },
 
   get gViewSourceUtils() this.browserWindow.gViewSourceUtils,
 
   /**
    * Initialize the Web Console instance.
    *
    * @return object
-   *         A Promise for the initialization.
+   *         A promise for the initialization.
    */
   init: function WC_init()
   {
     return this.ui.init().then(() => this);
   },
 
   /**
    * Retrieve the Web Console panel title.
@@ -458,27 +458,27 @@ WebConsole.prototype = {
     return null;
   },
 
   /**
    * Destroy the object. Call this method to avoid memory leaks when the Web
    * Console is closed.
    *
    * @return object
-   *         A Promise object that is resolved once the Web Console is closed.
+   *         A promise object that is resolved once the Web Console is closed.
    */
   destroy: function WC_destroy()
   {
     if (this._destroyer) {
       return this._destroyer.promise;
     }
 
     delete HUDService.hudReferences[this.hudId];
 
-    this._destroyer = Promise.defer();
+    this._destroyer = promise.defer();
 
     let popupset = this.mainPopupSet;
     let panels = popupset.querySelectorAll("panel[hudId=" + this.hudId + "]");
     for (let panel of panels) {
       panel.hidePopup();
     }
 
     let onDestroy = function WC_onDestroyUI() {
@@ -537,17 +537,17 @@ BrowserConsole.prototype = Heritage.exte
   _bc_destroyer: null,
 
   $init: WebConsole.prototype.init,
 
   /**
    * Initialize the Browser Console instance.
    *
    * @return object
-   *         A Promise for the initialization.
+   *         A promise for the initialization.
    */
   init: function BC_init()
   {
     if (this._bc_init) {
       return this._bc_init;
     }
 
     this.ui._filterPrefsPrefix = BROWSER_CONSOLE_FILTER_PREFS_PREFIX;
@@ -572,27 +572,27 @@ BrowserConsole.prototype = Heritage.exte
   },
 
   $destroy: WebConsole.prototype.destroy,
 
   /**
    * Destroy the object.
    *
    * @return object
-   *         A Promise object that is resolved once the Browser Console is closed.
+   *         A promise object that is resolved once the Browser Console is closed.
    */
   destroy: function BC_destroy()
   {
     if (this._bc_destroyer) {
       return this._bc_destroyer.promise;
     }
 
     this._telemetry.toolClosed("browserconsole");
 
-    this._bc_destroyer = Promise.defer();
+    this._bc_destroyer = promise.defer();
 
     let chromeWindow = this.chromeWindow;
     this.$destroy().then(() =>
       this.target.client.close(() => {
         HeadsUpDisplayUICommands._browserConsoleID = null;
         chromeWindow.close();
         this._bc_destroyer.resolve(null);
       }));
@@ -609,18 +609,18 @@ BrowserConsole.prototype = Heritage.exte
 var HeadsUpDisplayUICommands = {
   _browserConsoleID: null,
   _browserConsoleDefer: null,
 
   /**
    * Toggle the Web Console for the current tab.
    *
    * @return object
-   *         A Promise for either the opening of the toolbox that holds the Web
-   *         Console, or a Promise for the closing of the toolbox.
+   *         A promise for either the opening of the toolbox that holds the Web
+   *         Console, or a promise for the closing of the toolbox.
    */
   toggleHUD: function UIC_toggleHUD()
   {
     let window = HUDService.currentContext();
     let target = devtools.TargetFactory.forTab(window.gBrowser.selectedTab);
     let toolbox = gDevTools.getToolbox(target);
 
     return toolbox && toolbox.currentToolId == "webconsole" ?
@@ -656,21 +656,21 @@ var HeadsUpDisplayUICommands = {
       let hud = HUDService.getHudReferenceById(this._browserConsoleID);
       return hud.destroy();
     }
 
     if (this._browserConsoleDefer) {
       return this._browserConsoleDefer.promise;
     }
 
-    this._browserConsoleDefer = Promise.defer();
+    this._browserConsoleDefer = promise.defer();
 
     function connect()
     {
-      let deferred = Promise.defer();
+      let deferred = promise.defer();
 
       if (!DebuggerServer.initialized) {
         DebuggerServer.init();
         DebuggerServer.addBrowserActors();
       }
 
       let client = new DebuggerClient(DebuggerServer.connectPipe());
       client.connect(() =>
@@ -702,17 +702,17 @@ var HeadsUpDisplayUICommands = {
 
       return devtools.TargetFactory.forRemoteTab(options);
     }
 
     function openWindow(aTarget)
     {
       target = aTarget;
 
-      let deferred = Promise.defer();
+      let deferred = promise.defer();
 
       let win = Services.ww.openWindow(null, devtools.Tools.webConsole.url, "_blank",
                                        BROWSER_CONSOLE_WINDOW_FEATURES, null);
       win.addEventListener("DOMContentLoaded", function onLoad() {
         win.removeEventListener("DOMContentLoaded", onLoad);
 
         // Set the correct Browser Console title.
         let root = win.document.documentElement;
--- a/browser/devtools/webconsole/WebConsolePanel.jsm
+++ b/browser/devtools/webconsole/WebConsolePanel.jsm
@@ -5,18 +5,18 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = [ "WebConsolePanel" ];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-    "resource://gre/modules/commonjs/sdk/core/promise.js");
+XPCOMUtils.defineLazyModuleGetter(this, "promise",
+    "resource://gre/modules/commonjs/sdk/core/promise.js", "Promise");
 
 XPCOMUtils.defineLazyModuleGetter(this, "HUDService",
     "resource:///modules/HUDService.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "EventEmitter",
     "resource:///modules/devtools/shared/event-emitter.js");
 
 /**
@@ -30,26 +30,26 @@ function WebConsolePanel(iframeWindow, t
 
 WebConsolePanel.prototype = {
   hud: null,
 
   /**
    * Open is effectively an asynchronous constructor.
    *
    * @return object
-   *         A Promise that is resolved when the Web Console completes opening.
+   *         A promise that is resolved when the Web Console completes opening.
    */
   open: function WCP_open()
   {
     let parentDoc = this._toolbox.doc;
     let iframe = parentDoc.getElementById("toolbox-panel-iframe-webconsole");
     iframe.className = "web-console-frame";
 
     // Make sure the iframe content window is ready.
-    let deferredIframe = Promise.defer();
+    let deferredIframe = promise.defer();
     let win, doc;
     if ((win = iframe.contentWindow) &&
         (doc = win.document) &&
         doc.readyState == "complete") {
       deferredIframe.resolve(null);
     }
     else {
       iframe.addEventListener("load", function onIframeLoad() {
@@ -59,17 +59,17 @@ WebConsolePanel.prototype = {
     }
 
     // Local debugging needs to make the target remote.
     let promiseTarget;
     if (!this.target.isRemote) {
       promiseTarget = this.target.makeRemote();
     }
     else {
-      promiseTarget = Promise.resolve(this.target);
+      promiseTarget = promise.resolve(this.target);
     }
 
     // 1. Wait for the iframe to load.
     // 2. Wait for the remote target.
     // 3. Open the Web Console.
     return deferredIframe.promise
       .then(() => promiseTarget)
       .then((aTarget) => {
--- a/browser/devtools/webconsole/test/head.js
+++ b/browser/devtools/webconsole/test/head.js
@@ -9,18 +9,18 @@ let HUDService = tempScope.HUDService;
 Cu.import("resource://gre/modules/devtools/WebConsoleUtils.jsm", tempScope);
 let WebConsoleUtils = tempScope.WebConsoleUtils;
 Cu.import("resource:///modules/devtools/gDevTools.jsm", tempScope);
 let gDevTools = tempScope.gDevTools;
 Cu.import("resource://gre/modules/devtools/Loader.jsm", tempScope);
 let TargetFactory = tempScope.devtools.TargetFactory;
 Components.utils.import("resource://gre/modules/devtools/Console.jsm", tempScope);
 let console = tempScope.console;
-let Promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {}).Promise;
-// Promise._reportErrors = true; // please never leave me.
+let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {}).Promise;
+// promise._reportErrors = true; // please never leave me.
 
 let gPendingOutputTest = 0;
 
 // The various categories of messages.
 const CATEGORY_NETWORK = 0;
 const CATEGORY_CSS = 1;
 const CATEGORY_JS = 2;
 const CATEGORY_WEBDEV = 3;
@@ -402,17 +402,17 @@ function openInspector(aCallback, aTab =
  *        - isIterator (boolean): check if the property is an iterator.
  *        - isGetter (boolean): check if the property is a getter.
  *        - isGenerator (boolean): check if the property is a generator.
  *        - dontMatch (boolean): make sure the rule doesn't match any property.
  * @param object aOptions
  *        Options for matching:
  *        - webconsole: the WebConsole instance we work with.
  * @return object
- *         A Promise object that is resolved when all the rules complete
+ *         A promise object that is resolved when all the rules complete
  *         matching. The resolved callback is given an array of all the rules
  *         you wanted to check. Each rule has a new property: |matchedProp|
  *         which holds a reference to the Property object instance from the
  *         VariablesView. If the rule did not match, then |matchedProp| is
  *         undefined.
  */
 function findVariableViewProperties(aView, aRules, aOptions)
 {
@@ -434,20 +434,20 @@ function findVariableViewProperties(aVie
     // be expanded. Build the array of matchers, outstanding promises to be
     // resolved.
     let outstanding = [];
     finder(rules, aView, outstanding);
 
     // Process the rules that need to expand properties.
     let lastStep = processExpandRules.bind(null, expandRules);
 
-    // Return the results - a Promise resolved to hold the updated aRules array.
+    // Return the results - a promise resolved to hold the updated aRules array.
     let returnResults = onAllRulesMatched.bind(null, aRules);
 
-    return Promise.all(outstanding).then(lastStep).then(returnResults);
+    return promise.all(outstanding).then(lastStep).then(returnResults);
   }
 
   function onMatch(aProp, aRule, aMatched)
   {
     if (aMatched && !aRule.matchedProp) {
       aRule.matchedProp = aProp;
     }
   }
@@ -461,37 +461,37 @@ function findVariableViewProperties(aVie
       }
     }
   }
 
   function processExpandRules(aRules)
   {
     let rule = aRules.shift();
     if (!rule) {
-      return Promise.resolve(null);
+      return promise.resolve(null);
     }
 
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
     let expandOptions = {
       rootVariable: aView,
       expandTo: rule.name,
       webconsole: aOptions.webconsole,
     };
 
     variablesViewExpandTo(expandOptions).then(function onSuccess(aProp) {
       let name = rule.name;
       let lastName = name.split(".").pop();
       rule.name = lastName;
 
       let matched = matchVariablesViewProperty(aProp, rule, aOptions);
       return matched.then(onMatch.bind(null, aProp, rule)).then(function() {
         rule.name = name;
       });
     }, function onFailure() {
-      return Promise.resolve(null);
+      return promise.resolve(null);
     }).then(processExpandRules.bind(null, aRules)).then(function() {
       deferred.resolve(null);
     });
 
     return deferred.promise;
   }
 
   function onAllRulesMatched(aRules)
@@ -522,24 +522,24 @@ function findVariableViewProperties(aVie
  * @param object aProp
  *        The variable's view Property instance.
  * @param object aRule
  *        Rules for matching the property. See findVariableViewProperties() for
  *        details.
  * @param object aOptions
  *        Options for matching. See findVariableViewProperties().
  * @return object
- *         A Promise that is resolved when all the checks complete. Resolution
+ *         A promise that is resolved when all the checks complete. Resolution
  *         result is a boolean that tells your promise callback the match
  *         result: true or false.
  */
 function matchVariablesViewProperty(aProp, aRule, aOptions)
 {
   function resolve(aResult) {
-    return Promise.resolve(aResult);
+    return promise.resolve(aResult);
   }
 
   if (aRule.name) {
     let match = aRule.name instanceof RegExp ?
                 aRule.name.test(aProp.name) :
                 aProp.name == aRule.name;
     if (!match) {
       return resolve(false);
@@ -585,43 +585,43 @@ function matchVariablesViewProperty(aPro
     outstanding.push(isIterator.then((aResult) => {
       if (aResult != aRule.isIterator) {
         info("rule " + aRule.name + " iterator test failed");
       }
       return aResult == aRule.isIterator;
     }));
   }
 
-  outstanding.push(Promise.resolve(true));
+  outstanding.push(promise.resolve(true));
 
-  return Promise.all(outstanding).then(function _onMatchDone(aResults) {
+  return promise.all(outstanding).then(function _onMatchDone(aResults) {
     let ruleMatched = aResults.indexOf(false) == -1;
     return resolve(ruleMatched);
   });
 }
 
 /**
  * Check if the given variables view property is an iterator.
  *
  * @param object aProp
  *        The Property instance you want to check.
  * @param object aWebConsole
  *        The WebConsole instance to work with.
  * @return object
- *         A Promise that is resolved when the check completes. The resolved
+ *         A promise that is resolved when the check completes. The resolved
  *         callback is given a boolean: true if the property is an iterator, or
  *         false otherwise.
  */
 function isVariableViewPropertyIterator(aProp, aWebConsole)
 {
   if (aProp.displayValue == "Iterator") {
-    return Promise.resolve(true);
+    return promise.resolve(true);
   }
 
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   variablesViewExpandTo({
     rootVariable: aProp,
     expandTo: "__proto__.__iterator__",
     webconsole: aWebConsole,
   }).then(function onSuccess(aProp) {
     deferred.resolve(true);
   }, function onFailure() {
@@ -639,36 +639,36 @@ function isVariableViewPropertyIterator(
  *        Options for view expansion:
  *        - rootVariable: start from the given scope/variable/property.
  *        - expandTo: string made up of property names you want to expand.
  *        For example: "body.firstChild.nextSibling" given |rootVariable:
  *        document|.
  *        - webconsole: a WebConsole instance. If this is not provided all
  *        property expand() calls will be considered sync. Things may fail!
  * @return object
- *         A Promise that is resolved only when the last property in |expandTo|
+ *         A promise that is resolved only when the last property in |expandTo|
  *         is found, and rejected otherwise. Resolution reason is always the
  *         last property - |nextSibling| in the example above. Rejection is
  *         always the last property that was found.
  */
 function variablesViewExpandTo(aOptions)
 {
   let root = aOptions.rootVariable;
   let expandTo = aOptions.expandTo.split(".");
   let jsterm = (aOptions.webconsole || {}).jsterm;
-  let lastDeferred = Promise.defer();
+  let lastDeferred = promise.defer();
 
   function fetch(aProp)
   {
     if (!aProp.onexpand) {
       ok(false, "property " + aProp.name + " cannot be expanded: !onexpand");
-      return Promise.reject(aProp);
+      return promise.reject(aProp);
     }
 
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     if (aProp._fetched || !jsterm) {
       executeSoon(function() {
         deferred.resolve(aProp);
       });
     }
     else {
       jsterm.once("variablesview-fetched", function _onFetchProp() {
@@ -773,31 +773,31 @@ function updateVariablesViewProperty(aOp
 
 /**
  * Open the JavaScript debugger.
  *
  * @param object aOptions
  *        Options for opening the debugger:
  *        - tab: the tab you want to open the debugger for.
  * @return object
- *         A Promise that is resolved once the debugger opens, or rejected if
+ *         A promise that is resolved once the debugger opens, or rejected if
  *         the open fails. The resolution callback is given one argument, an
  *         object that holds the following properties:
  *         - target: the Target object for the Tab.
  *         - toolbox: the Toolbox instance.
  *         - panel: the jsdebugger panel instance.
  *         - panelWin: the window object of the panel iframe.
  */
 function openDebugger(aOptions = {})
 {
   if (!aOptions.tab) {
     aOptions.tab = gBrowser.selectedTab;
   }
 
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   let target = TargetFactory.forTab(aOptions.tab);
   let toolbox = gDevTools.getToolbox(target);
   let dbgPanelAlreadyOpen = toolbox.getPanel("jsdebugger");
 
   gDevTools.showToolbox(target, "jsdebugger").then(function onSuccess(aToolbox) {
     let panel = aToolbox.getCurrentPanel();
     let panelWin = panel.panelWin;
@@ -880,17 +880,17 @@ function getMessageElementText(aElement)
  *            message.
  *            - longString: boolean, set to |true} to match long strings in the
  *            message.
  *            - objects: boolean, set to |true| if you expect inspectable
  *            objects in the message.
  *            - source: object that can hold one property: url. This is used to
  *            match the source URL of the message.
  * @return object
- *         A Promise object is returned once the messages you want are found.
+ *         A promise object is returned once the messages you want are found.
  *         The promise is resolved with the array of rule objects you give in
  *         the |messages| property. Each objects is the same as provided, with
  *         additional properties:
  *         - matched: a Set of web console messages that matched the rule.
  *         - clickableElements: a list of inspectable objects. This is available
  *         if any of the following properties are present in the rule:
  *         |consoleTrace| or |objects|.
  *         - longStrings: a list of long string ellipsis elements you can click
@@ -899,17 +899,17 @@ function getMessageElementText(aElement)
  */
 function waitForMessages(aOptions)
 {
   gPendingOutputTest++;
   let webconsole = aOptions.webconsole;
   let rules = WebConsoleUtils.cloneObject(aOptions.messages, true);
   let rulesMatched = 0;
   let listenerAdded = false;
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
 
   function checkText(aRule, aText)
   {
     let result;
     if (typeof aRule == "string") {
       result = aText.indexOf(aRule) > -1;
     }
     else if (aRule instanceof RegExp) {
--- a/browser/devtools/webconsole/webconsole.js
+++ b/browser/devtools/webconsole/webconsole.js
@@ -26,18 +26,18 @@ XPCOMUtils.defineLazyModuleGetter(this, 
                                   "resource:///modules/NetworkPanel.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "AutocompletePopup",
                                   "resource:///modules/devtools/AutocompletePopup.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "WebConsoleUtils",
                                   "resource://gre/modules/devtools/WebConsoleUtils.jsm");
 
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-                                  "resource://gre/modules/commonjs/sdk/core/promise.js");
+XPCOMUtils.defineLazyModuleGetter(this, "promise",
+                                  "resource://gre/modules/commonjs/sdk/core/promise.js", "Promise");
 
 XPCOMUtils.defineLazyModuleGetter(this, "VariablesView",
                                   "resource:///modules/devtools/VariablesView.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "VariablesViewController",
                                   "resource:///modules/devtools/VariablesViewController.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "EventEmitter",
@@ -234,17 +234,17 @@ WebConsoleFrame.prototype = {
 
   /**
    * Getter for the xul:popupset that holds any popups we open.
    * @type nsIDOMElement
    */
   get popupset() this.owner.mainPopupSet,
 
   /**
-   * Holds the initialization Promise object.
+   * Holds the initialization promise object.
    * @private
    * @type object
    */
   _initDefer: null,
 
   /**
    * Holds the network requests currently displayed by the Web Console. Each key
    * represents the connection ID and the value is network request information.
@@ -362,17 +362,17 @@ WebConsoleFrame.prototype = {
    * Tells whether to save the bodies of network requests and responses.
    * Disabled by default to save memory.
    *
    * @return boolean
    *         The saveRequestAndResponseBodies pref value.
    */
   getSaveRequestAndResponseBodies:
   function WCF_getSaveRequestAndResponseBodies() {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
     let toGet = [
       "NetworkMonitor.saveRequestAndResponseBodies"
     ];
 
     // Make sure the web console client connection is established first.
     this.webConsoleClient.getPreferences(toGet, aResponse => {
       if (!aResponse.error) {
         this._saveRequestAndResponseBodies = aResponse.preferences[toGet[0]];
@@ -389,17 +389,17 @@ WebConsoleFrame.prototype = {
   /**
    * Setter for saving of network request and response bodies.
    *
    * @param boolean aValue
    *        The new value you want to set.
    */
   setSaveRequestAndResponseBodies:
   function WCF_setSaveRequestAndResponseBodies(aValue) {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
     let newValue = !!aValue;
     let toSet = {
       "NetworkMonitor.saveRequestAndResponseBodies": newValue,
     };
 
     // Make sure the web console client connection is established first.
     this.webConsoleClient.setPreferences(toSet, aResponse => {
       if (!aResponse.error) {
@@ -420,39 +420,39 @@ WebConsoleFrame.prototype = {
    */
   get persistLog() {
     return Services.prefs.getBoolPref(PREF_PERSISTLOG);
   },
 
   /**
    * Initialize the WebConsoleFrame instance.
    * @return object
-   *         A Promise object for the initialization.
+   *         A promise object for the initialization.
    */
   init: function WCF_init()
   {
     this._initUI();
     return this._initConnection();
   },
 
   /**
    * Connect to the server using the remote debugging protocol.
    *
    * @private
    * @return object
-   *         A Promise object that is resolved/reject based on the connection
+   *         A promise object that is resolved/reject based on the connection
    *         result.
    */
   _initConnection: function WCF__initConnection()
   {
     if (this._initDefer) {
       return this._initDefer.promise;
     }
 
-    this._initDefer = Promise.defer();
+    this._initDefer = promise.defer();
     this.proxy = new WebConsoleConnectionProxy(this, this.owner.target);
 
     this.proxy.connect().then(() => { // on success
       this._initDefer.resolve(this);
     }, (aReason) => { // on failure
       let node = this.createMessageNode(CATEGORY_JS, SEVERITY_ERROR,
                                         aReason.error + ": " + aReason.message);
       this.outputMessage(CATEGORY_JS, node);
@@ -2722,26 +2722,26 @@ WebConsoleFrame.prototype = {
     this.owner.openLink(item.url);
   },
 
   /**
    * Destroy the WebConsoleFrame object. Call this method to avoid memory leaks
    * when the Web Console is closed.
    *
    * @return object
-   *         A Promise that is resolved when the WebConsoleFrame instance is
+   *         A promise that is resolved when the WebConsoleFrame instance is
    *         destroyed.
    */
   destroy: function WCF_destroy()
   {
     if (this._destroyer) {
       return this._destroyer.promise;
     }
 
-    this._destroyer = Promise.defer();
+    this._destroyer = promise.defer();
 
     this._repeatNodes = {};
     this._outputQueue = [];
     this._pruneCategoriesQueue = {};
     this._networkRequests = {};
 
     if (this._outputTimerInitialized) {
       this._outputTimerInitialized = false;
@@ -3129,22 +3129,22 @@ JSTerm.prototype = {
    *        execute.
    *        - frame: tells the stackframe depth to evaluate the string in. If
    *        the jsdebugger is paused, you can pick the stackframe to be used for
    *        evaluation. Use |this.SELECTED_FRAME| to always pick the
    *        user-selected stackframe.
    *        If you do not provide a |frame| the string will be evaluated in the
    *        global content window.
    * @return object
-   *         A Promise object that is resolved when the server response is
+   *         A promise object that is resolved when the server response is
    *         received.
    */
   requestEvaluation: function JST_requestEvaluation(aString, aOptions = {})
   {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     function onResult(aResponse) {
       if (!aResponse.error) {
         deferred.resolve(aResponse);
       }
       else {
         deferred.reject(aResponse);
       }
@@ -3203,17 +3203,17 @@ JSTerm.prototype = {
    *        - hideFilterInput: optional boolean, |true| if you want to hide the
    *        variables view filter input.
    *        - targetElement: optional nsIDOMElement to append the variables view
    *        to. An iframe element is used as a container for the view. If this
    *        option is not used, then the variables view opens in the sidebar.
    *        - autofocus: optional boolean, |true| if you want to give focus to
    *        the variables view window after open, |false| otherwise.
    * @return object
-   *         A Promise object that is resolved when the variables view has
+   *         A promise object that is resolved when the variables view has
    *         opened. The new variables view instance is given to the callbacks.
    */
   openVariablesView: function JST_openVariablesView(aOptions)
   {
     let onContainerReady = (aWindow) => {
       let container = aWindow.document.querySelector("#variables");
       let view = this._variablesView;
       if (!view || aOptions.targetElement) {
@@ -3233,40 +3233,40 @@ JSTerm.prototype = {
       if (!aOptions.targetElement && aOptions.autofocus) {
         aWindow.focus();
       }
 
       this.emit("variablesview-open", view, aOptions);
       return view;
     };
 
-    let promise;
+    let openPromise;
     if (aOptions.targetElement) {
-      let deferred = Promise.defer();
-      promise = deferred.promise;
+      let deferred = promise.defer();
+      openPromise = deferred.promise;
       let document = aOptions.targetElement.ownerDocument;
       let iframe = document.createElement("iframe");
 
       iframe.addEventListener("load", function onIframeLoad(aEvent) {
         iframe.removeEventListener("load", onIframeLoad, true);
         deferred.resolve(iframe.contentWindow);
       }, true);
 
       iframe.flex = 1;
       iframe.setAttribute("src", VARIABLES_VIEW_URL);
       aOptions.targetElement.appendChild(iframe);
     }
     else {
       if (!this.sidebar) {
         this._createSidebar();
       }
-      promise = this._addVariablesViewSidebarTab();
-    }
-
-    return promise.then(onContainerReady);
+      openPromise = this._addVariablesViewSidebarTab();
+    }
+
+    return openPromise.then(onContainerReady);
   },
 
   /**
    * Create the Web Console sidebar.
    *
    * @see devtools/framework/sidebar.js
    * @private
    */
@@ -3278,21 +3278,21 @@ JSTerm.prototype = {
     this.sidebar.show();
   },
 
   /**
    * Add the variables view tab to the sidebar.
    *
    * @private
    * @return object
-   *         A Promise object for the adding of the new tab.
+   *         A promise object for the adding of the new tab.
    */
   _addVariablesViewSidebarTab: function JST__addVariablesViewSidebarTab()
   {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
 
     let onTabReady = () => {
       let window = this.sidebar.getWindowForTab("variablesview");
       deferred.resolve(window);
     };
 
     let tab = this.sidebar.getTab("variablesview");
     if (tab) {
@@ -4657,34 +4657,34 @@ WebConsoleConnectionProxy.prototype = {
    * @type boolean
    */
   _hasNativeConsoleAPI: false,
 
   /**
    * Initialize a debugger client and connect it to the debugger server.
    *
    * @return object
-   *         A Promise object that is resolved/rejected based on the success of
+   *         A promise object that is resolved/rejected based on the success of
    *         the connection initialization.
    */
   connect: function WCCP_connect()
   {
     if (this._connectDefer) {
       return this._connectDefer.promise;
     }
 
-    this._connectDefer = Promise.defer();
+    this._connectDefer = promise.defer();
 
     let timeout = Services.prefs.getIntPref(PREF_CONNECTION_TIMEOUT);
     this._connectTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
     this._connectTimer.initWithCallback(this._connectionTimeout,
                                         timeout, Ci.nsITimer.TYPE_ONE_SHOT);
 
-    let promise = this._connectDefer.promise;
-    promise.then(function _onSucess() {
+    let connPromise = this._connectDefer.promise;
+    connPromise.then(function _onSucess() {
       this._connectTimer.cancel();
       this._connectTimer = null;
     }.bind(this), function _onFailure() {
       this._connectTimer = null;
     }.bind(this));
 
     let client = this.client = this.target.client;
 
@@ -4700,17 +4700,17 @@ WebConsoleConnectionProxy.prototype = {
 
     this._consoleActor = this.target.form.consoleActor;
     if (!this.target.chrome) {
       let tab = this.target.form;
       this.owner.onLocationChange(tab.url, tab.title);
     }
     this._attachConsole();
 
-    return promise;
+    return connPromise;
   },
 
   /**
    * Connection timeout handler.
    * @private
    */
   _connectionTimeout: function WCCP__connectionTimeout()
   {
@@ -4773,17 +4773,17 @@ WebConsoleConnectionProxy.prototype = {
     if (aResponse.error) {
       Cu.reportError("Web Console getCachedMessages error: " + aResponse.error +
                      " " + aResponse.message);
       this._connectDefer.reject(aResponse);
       return;
     }
 
     if (!this._connectTimer) {
-      // This happens if the Promise is rejected (eg. a timeout), but the
+      // This happens if the promise is rejected (eg. a timeout), but the
       // connection attempt is successful, nonetheless.
       Cu.reportError("Web Console getCachedMessages error: invalid state.");
     }
 
     this.owner.displayCachedMessages(aResponse.messages);
 
     if (!this._hasNativeConsoleAPI) {
       this.owner.logWarningAboutReplacedAPI();
@@ -4955,25 +4955,25 @@ WebConsoleConnectionProxy.prototype = {
       this.client.release(aActor);
     }
   },
 
   /**
    * Disconnect the Web Console from the remote server.
    *
    * @return object
-   *         A Promise object that is resolved when disconnect completes.
+   *         A promise object that is resolved when disconnect completes.
    */
   disconnect: function WCCP_disconnect()
   {
     if (this._disconnecter) {
       return this._disconnecter.promise;
     }
 
-    this._disconnecter = Promise.defer();
+    this._disconnecter = promise.defer();
 
     if (!this.client) {
       this._disconnecter.resolve(null);
       return this._disconnecter.promise;
     }
 
     this.client.removeListener("logMessage", this._onLogMessage);
     this.client.removeListener("pageError", this._onPageError);
--- a/toolkit/devtools/Loader.jsm
+++ b/toolkit/devtools/Loader.jsm
@@ -14,17 +14,17 @@ Cu.import("resource://gre/modules/XPCOMU
 Cu.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "NetUtil", "resource://gre/modules/NetUtil.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "FileUtils", "resource://gre/modules/FileUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "console", "resource://gre/modules/devtools/Console.jsm");
 
 let loader = Cu.import("resource://gre/modules/commonjs/toolkit/loader.js", {}).Loader;
-let Promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {}).Promise;
+let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js", {}).Promise;
 
 this.EXPORTED_SYMBOLS = ["devtools"];
 
 /**
  * Providers are different strategies for loading the devtools.
  */
 
 let loaderGlobals = {
@@ -50,17 +50,17 @@ var BuiltinProvider = {
         "devtools/server": "resource://gre/modules/devtools/server",
 
         // Allow access to xpcshell test items from the loader.
         "xpcshell-test": "resource://test"
       },
       globals: loaderGlobals
     });
 
-    return Promise.resolve(undefined);
+    return promise.resolve(undefined);
   },
 
   unload: function(reason) {
     loader.unload(this.loader, reason);
     delete this.loader;
   },
 };
 
@@ -99,31 +99,31 @@ var SrcdirProvider = {
   },
 
   unload: function(reason) {
     loader.unload(this.loader, reason);
     delete this.loader;
   },
 
   _readFile: function(filename) {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
     let file = new FileUtils.File(filename);
     NetUtil.asyncFetch(file, (inputStream, status) => {
       if (!Components.isSuccessCode(status)) {
         deferred.reject(new Error("Couldn't load manifest: " + filename + "\n"));
         return;
       }
       var data = NetUtil.readInputStreamToString(inputStream, inputStream.available());
       deferred.resolve(data);
     });
     return deferred.promise;
   },
 
   _writeFile: function(filename, data) {
-    let deferred = Promise.defer();
+    let deferred = promise.defer();
     let file = new FileUtils.File(filename);
 
     var ostream = FileUtils.openSafeFileOutputStream(file)
 
     var converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
                     createInstance(Ci.nsIScriptableUnicodeConverter);
     converter.charset = "UTF-8";
     var istream = converter.convertToInputStream(data);
--- a/toolkit/devtools/client/dbg-client.jsm
+++ b/toolkit/devtools/client/dbg-client.jsm
@@ -15,18 +15,18 @@ this.EXPORTED_SYMBOLS = ["DebuggerTransp
                          "RootClient",
                          "debuggerSocketConnect",
                          "LongStringClient",
                          "GripClient"];
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/NetUtil.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
-const { defer, resolve, reject } = Promise;
+let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js").Promise;
+const { defer, resolve, reject } = promise;
 
 XPCOMUtils.defineLazyServiceGetter(this, "socketTransportService",
                                    "@mozilla.org/network/socket-transport-service;1",
                                    "nsISocketTransportService");
 
 XPCOMUtils.defineLazyModuleGetter(this, "WebConsoleClient",
                                   "resource://gre/modules/devtools/WebConsoleClient.jsm");
 
--- a/toolkit/devtools/gcli/gcli.jsm
+++ b/toolkit/devtools/gcli/gcli.jsm
@@ -188,17 +188,17 @@ define('gcli/index', ['require', 'export
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 define('gcli/types/basic', ['require', 'exports', 'module' , 'util/promise', 'util/util', 'util/l10n', 'gcli/types', 'gcli/types/selection', 'gcli/argument'], function(require, exports, module) {
 
 'use strict';
 
-var Promise = require('util/promise');
+var promise = require('util/promise');
 var util = require('util/util');
 var l10n = require('util/l10n');
 var types = require('gcli/types');
 var Type = require('gcli/types').Type;
 var Status = require('gcli/types').Status;
 var Conversion = require('gcli/types').Conversion;
 var ArrayConversion = require('gcli/types').ArrayConversion;
 var SelectionType = require('gcli/types/selection').SelectionType;
@@ -265,17 +265,17 @@ StringType.prototype.stringify = functio
        .replace(/'/g, '\\\'')
        .replace(/"/g, '\\"')
        .replace(/{/g, '\\{')
        .replace(/}/g, '\\}');
 };
 
 StringType.prototype.parse = function(arg, context) {
   if (!this._allowBlank && (arg.text == null || arg.text === '')) {
-    return Promise.resolve(new Conversion(undefined, arg, Status.INCOMPLETE, ''));
+    return promise.resolve(new Conversion(undefined, arg, Status.INCOMPLETE, ''));
   }
 
   // The string '\\' (i.e. an escaped \ (represented here as '\\\\' because it
   // is double escaped)) is first converted to a private unicode character and
   // then at the end from \uF000 to a single '\' to avoid the string \\n being
   // converted first to \n and then to a <LF>
 
   var value = arg.text
@@ -289,17 +289,17 @@ StringType.prototype.parse = function(ar
        .replace(/\\r/g, '\r')
        .replace(/\\ /g, ' ')
        .replace(/\\'/g, '\'')
        .replace(/\\"/g, '"')
        .replace(/\\{/g, '{')
        .replace(/\\}/g, '}')
        .replace(/\uF000/g, '\\');
 
-  return Promise.resolve(new Conversion(value, arg));
+  return promise.resolve(new Conversion(value, arg));
 };
 
 StringType.prototype.name = 'string';
 
 exports.StringType = StringType;
 
 
 /**
@@ -356,50 +356,50 @@ NumberType.prototype.getMax = function(c
       return this._max;
     }
   }
   return undefined;
 };
 
 NumberType.prototype.parse = function(arg, context) {
   if (arg.text.replace(/^\s*-?/, '').length === 0) {
-    return Promise.resolve(new Conversion(undefined, arg, Status.INCOMPLETE, ''));
+    return promise.resolve(new Conversion(undefined, arg, Status.INCOMPLETE, ''));
   }
 
   if (!this._allowFloat && (arg.text.indexOf('.') !== -1)) {
     var message = l10n.lookupFormat('typesNumberNotInt2', [ arg.text ]);
-    return Promise.resolve(new Conversion(undefined, arg, Status.ERROR, message));
+    return promise.resolve(new Conversion(undefined, arg, Status.ERROR, message));
   }
 
   var value;
   if (this._allowFloat) {
     value = parseFloat(arg.text);
   }
   else {
     value = parseInt(arg.text, 10);
   }
 
   if (isNaN(value)) {
     var message = l10n.lookupFormat('typesNumberNan', [ arg.text ]);
-    return Promise.resolve(new Conversion(undefined, arg, Status.ERROR, message));
+    return promise.resolve(new Conversion(undefined, arg, Status.ERROR, message));
   }
 
   var max = this.getMax(context);
   if (max != null && value > max) {
     var message = l10n.lookupFormat('typesNumberMax', [ value, max ]);
-    return Promise.resolve(new Conversion(undefined, arg, Status.ERROR, message));
+    return promise.resolve(new Conversion(undefined, arg, Status.ERROR, message));
   }
 
   var min = this.getMin(context);
   if (min != null && value < min) {
     var message = l10n.lookupFormat('typesNumberMin', [ value, min ]);
-    return Promise.resolve(new Conversion(undefined, arg, Status.ERROR, message));
-  }
-
-  return Promise.resolve(new Conversion(value, arg));
+    return promise.resolve(new Conversion(undefined, arg, Status.ERROR, message));
+  }
+
+  return promise.resolve(new Conversion(value, arg));
 };
 
 NumberType.prototype.decrement = function(value, context) {
   if (typeof value !== 'number' || isNaN(value)) {
     return this.getMax(context) || 1;
   }
   var newValue = value - this._step;
   // Snap to the nearest incremental of the step
@@ -461,34 +461,34 @@ BooleanType.prototype = Object.create(Se
 
 BooleanType.prototype.lookup = [
   { name: 'false', value: false },
   { name: 'true', value: true }
 ];
 
 BooleanType.prototype.parse = function(arg, context) {
   if (arg.type === 'TrueNamedArgument') {
-    return Promise.resolve(new Conversion(true, arg));
+    return promise.resolve(new Conversion(true, arg));
   }
   if (arg.type === 'FalseNamedArgument') {
-    return Promise.resolve(new Conversion(false, arg));
+    return promise.resolve(new Conversion(false, arg));
   }
   return SelectionType.prototype.parse.call(this, arg, context);
 };
 
 BooleanType.prototype.stringify = function(value, context) {
   if (value == null) {
     return '';
   }
   return '' + value;
 };
 
 BooleanType.prototype.getBlank = function(context) {
   return new Conversion(false, new BlankArgument(), Status.VALID, '',
-                        Promise.resolve(this.lookup));
+                        promise.resolve(this.lookup));
 };
 
 BooleanType.prototype.name = 'boolean';
 
 exports.BooleanType = BooleanType;
 
 
 /**
@@ -567,17 +567,17 @@ function BlankType(typeSpec) {
 
 BlankType.prototype = Object.create(Type.prototype);
 
 BlankType.prototype.stringify = function(value, context) {
   return '';
 };
 
 BlankType.prototype.parse = function(arg, context) {
-  return Promise.resolve(new Conversion(undefined, arg));
+  return promise.resolve(new Conversion(undefined, arg));
 };
 
 BlankType.prototype.name = 'blank';
 
 exports.BlankType = BlankType;
 
 
 /**
@@ -619,17 +619,17 @@ ArrayType.prototype.parse = function(arg
   var subArgParse = function(subArg) {
     return this.subtype.parse(subArg, context).then(function(conversion) {
       subArg.conversion = conversion;
       return conversion;
     }.bind(this));
   }.bind(this);
 
   var conversionPromises = arg.getArguments().map(subArgParse);
-  return Promise.all(conversionPromises).then(function(conversions) {
+  return promise.all(conversionPromises).then(function(conversions) {
     return new ArrayConversion(conversions, arg);
   });
 };
 
 ArrayType.prototype.getBlank = function(context) {
   return new ArrayConversion([], new ArrayArgument());
 };
 
@@ -901,17 +901,17 @@ exports.createEvent = function(name) {
     enumerable: true
   });
 
   return event;
 };
 
 //------------------------------------------------------------------------------
 
-var Promise = require('util/promise');
+var promise = require('util/promise');
 
 /**
  * Utility to convert a resolved promise to a concrete value.
  * Warning: This is something of an experiment. The alternative of mixing
  * concrete/promise return values could be better.
  */
 exports.synchronize = function(promise) {
   if (promise == null || typeof promise.then !== 'function') {
@@ -946,20 +946,20 @@ exports.synchronize = function(promise) 
  * @param action A function to call for each member of the array
  * @param scope Optional object to use as 'this' for the function calls
  * @return A promise which is resolved (with an array of resolution values)
  * when all the array members have been passed to the action function, and
  * rejected as soon as any of the action function calls fails 
  */
 exports.promiseEach = function(array, action, scope) {
   if (array.length === 0) {
-    return Promise.resolve([]);
-  }
-
-  var deferred = Promise.defer();
+    return promise.resolve([]);
+  }
+
+  var deferred = promise.defer();
   var replies = [];
 
   var callNext = function(index) {
     var onSuccess = function(reply) {
       replies[index] = reply;
 
       if (index + 1 >= array.length) {
         deferred.resolve(replies);
@@ -969,17 +969,17 @@ exports.promiseEach = function(array, ac
       }
     };
 
     var onFailure = function(ex) {
       deferred.reject(ex);
     };
 
     var reply = action.call(scope, array[index], index, array);
-    Promise.resolve(reply).then(onSuccess).then(null, onFailure);
+    promise.resolve(reply).then(onSuccess).then(null, onFailure);
   };
 
   callNext(0);
   return deferred.promise;
 };
 
 /**
  * Catching errors from promises isn't as simple as:
@@ -1575,17 +1575,17 @@ exports.lookupFormat = function(key, swa
  * limitations under the License.
  */
 
 define('gcli/types', ['require', 'exports', 'module' , 'util/util', 'util/promise', 'gcli/argument'], function(require, exports, module) {
 
 'use strict';
 
 var util = require('util/util');
-var Promise = require('util/promise');
+var promise = require('util/promise');
 var Argument = require('gcli/argument').Argument;
 var BlankArgument = require('gcli/argument').BlankArgument;
 
 
 /**
  * Some types can detect validity, that is to say they can distinguish between
  * valid and invalid values.
  * We might want to change these constants to be numbers for better performance
@@ -1781,26 +1781,26 @@ Conversion.prototype.toString = function
  *   UI should not append a space to the completion
  * - value (optional): If a value property is present, this will be used as the
  *   value of the conversion, otherwise the item itself will be used.
  */
 Conversion.prototype.getPredictions = function() {
   if (typeof this.predictions === 'function') {
     return this.predictions();
   }
-  return Promise.resolve(this.predictions || []);
+  return promise.resolve(this.predictions || []);
 };
 
 /**
  * Return a promise of an index constrained by the available predictions.
  * i.e. (index % predicitons.length)
  */
 Conversion.prototype.constrainPredictionIndex = function(index) {
   if (index == null) {
-    return Promise.resolve();
+    return promise.resolve();
   }
 
   return this.getPredictions().then(function(value) {
     if (value.length === 0) {
       return undefined;
     }
 
     index = index % value.length;
@@ -2707,17 +2707,17 @@ exports.ArrayArgument = ArrayArgument;
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 define('gcli/types/selection', ['require', 'exports', 'module' , 'util/promise', 'util/util', 'util/l10n', 'gcli/types', 'gcli/types/spell', 'gcli/argument'], function(require, exports, module) {
 
 'use strict';
 
-var Promise = require('util/promise');
+var promise = require('util/promise');
 var util = require('util/util');
 var l10n = require('util/l10n');
 var types = require('gcli/types');
 var Type = require('gcli/types').Type;
 var Status = require('gcli/types').Status;
 var Conversion = require('gcli/types').Conversion;
 var spell = require('gcli/types/spell');
 var BlankArgument = require('gcli/argument').BlankArgument;
@@ -2838,30 +2838,30 @@ var forceAsync = false;
 /**
  * Both 'lookup' and 'data' properties (see docs on SelectionType constructor)
  * in addition to being real data can be a function or a promise, or even a
  * function which returns a promise of real data, etc. This takes a thing and
  * returns a promise of actual values.
  */
 function resolve(thing, context, neverForceAsync) {
   if (forceAsync && !neverForceAsync) {
-    var deferred = Promise.defer();
+    var deferred = promise.defer();
     setTimeout(function() {
-      Promise.resolve(thing).then(function(resolved) {
+      promise.resolve(thing).then(function(resolved) {
         if (typeof resolved === 'function') {
           resolved = resolve(resolved(), neverForceAsync);
         }
 
         deferred.resolve(resolved);
       });
     }, 500);
     return deferred.promise;
   }
 
-  return Promise.resolve(thing).then(function(resolved) {
+  return promise.resolve(thing).then(function(resolved) {
     if (typeof resolved === 'function') {
       return resolve(resolved(context), context, neverForceAsync);
     }
     return resolved;
   });
 }
 
 /**
@@ -2880,17 +2880,17 @@ function dataToLookup(data) {
 };
 
 /**
  * Return a list of possible completions for the given arg.
  * @param arg The initial input to match
  * @return A trimmed array of string:value pairs
  */
 SelectionType.prototype._findPredictions = function(arg, context) {
-  return Promise.resolve(this.getLookup(context)).then(function(lookup) {
+  return promise.resolve(this.getLookup(context)).then(function(lookup) {
     var predictions = [];
     var i, option;
     var maxPredictions = Conversion.maxPredictions;
     var match = arg.text.toLowerCase();
 
     // If the arg has a suffix then we're kind of 'done'. Only an exact match
     // will do.
     if (arg.suffix.length > 0) {
@@ -2975,33 +2975,33 @@ SelectionType.prototype._addToPrediction
   predictions.push(option);
 };
 
 SelectionType.prototype.parse = function(arg, context) {
   return this._findPredictions(arg, context).then(function(predictions) {
     if (predictions.length === 0) {
       var msg = l10n.lookupFormat('typesSelectionNomatch', [ arg.text ]);
       return new Conversion(undefined, arg, Status.ERROR, msg,
-                            Promise.resolve(predictions));
+                            promise.resolve(predictions));
     }
 
     if (predictions[0].name === arg.text) {
       var value = predictions[0].value;
       return new Conversion(value, arg, Status.VALID, '',
-                            Promise.resolve(predictions));
+                            promise.resolve(predictions));
     }
 
     return new Conversion(undefined, arg, Status.INCOMPLETE, '',
-                          Promise.resolve(predictions));
+                          promise.resolve(predictions));
   }.bind(this));
 };
 
 SelectionType.prototype.getBlank = function(context) {
   var predictFunc = function() {
-    return Promise.resolve(this.getLookup(context)).then(function(lookup) {
+    return promise.resolve(this.getLookup(context)).then(function(lookup) {
       return lookup.filter(function(option) {
         return !option.value.hidden;
       }).slice(0, Conversion.maxPredictions - 1);
     });
   }.bind(this);
 
   return new Conversion(undefined, new BlankArgument(), Status.INCOMPLETE, '',
                         predictFunc);
@@ -3214,17 +3214,17 @@ exports.correct = function(word, names) 
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 define('gcli/types/command', ['require', 'exports', 'module' , 'util/promise', 'util/l10n', 'gcli/canon', 'gcli/types', 'gcli/types/selection'], function(require, exports, module) {
 
 'use strict';
 
-var Promise = require('util/promise');
+var promise = require('util/promise');
 var l10n = require('util/l10n');
 var canon = require('gcli/canon');
 var types = require('gcli/types');
 var SelectionType = require('gcli/types/selection').SelectionType;
 var Status = require('gcli/types').Status;
 var Conversion = require('gcli/types').Conversion;
 
 
@@ -3275,17 +3275,17 @@ ParamType.prototype.lookup = function() 
 };
 
 ParamType.prototype.parse = function(arg, context) {
   if (this.isIncompleteName) {
     return SelectionType.prototype.parse.call(this, arg, context);
   }
   else {
     var message = l10n.lookup('cliUnusedArg');
-    return Promise.resolve(new Conversion(undefined, arg, Status.ERROR, message));
+    return promise.resolve(new Conversion(undefined, arg, Status.ERROR, message));
   }
 };
 
 
 /**
  * Select from the available commands.
  * This is very similar to a SelectionType, however the level of hackery in
  * SelectionType to make it handle Commands correctly was to high, so we
@@ -3375,17 +3375,17 @@ CommandType.prototype.parse = function(a
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 define('gcli/canon', ['require', 'exports', 'module' , 'util/promise', 'util/util', 'util/l10n', 'gcli/types'], function(require, exports, module) {
 
 'use strict';
 
-var Promise = require('util/promise');
+var promise = require('util/promise');
 var util = require('util/util');
 var l10n = require('util/l10n');
 
 var types = require('gcli/types');
 var Status = require('gcli/types').Status;
 
 /**
  * Implement the localization algorithm for any documentation objects (i.e.
@@ -3902,17 +3902,17 @@ exports.CommandOutputManager = CommandOu
  * Licensed under the New BSD license. See LICENSE.txt or:
  * http://opensource.org/licenses/BSD-3-Clause
  */
 
 define('gcli/types/date', ['require', 'exports', 'module' , 'util/promise', 'util/l10n', 'gcli/types'], function(require, exports, module) {
 
 'use strict';
 
-var Promise = require('util/promise');
+var promise = require('util/promise');
 var l10n = require('util/l10n');
 
 var types = require('gcli/types');
 var Type = require('gcli/types').Type;
 var Status = require('gcli/types').Status;
 var Conversion = require('gcli/types').Conversion;
 
 
@@ -4024,17 +4024,17 @@ DateType.prototype.getMax = function(con
   }
   return undefined;
 };
 
 DateType.prototype.parse = function(arg, context) {
   var value;
 
   if (arg.text.replace(/\s/g, '').length === 0) {
-    return Promise.resolve(new Conversion(undefined, arg, Status.INCOMPLETE, ''));
+    return promise.resolve(new Conversion(undefined, arg, Status.INCOMPLETE, ''));
   }
 
   // Lots of room for improvement here: 1h ago, in two days, etc.
   // Should "1h ago" dynamically update the step?
   if (arg.text === 'now') {
     value = new Date();
   }
   else if (arg.text === 'yesterday') {
@@ -4043,23 +4043,23 @@ DateType.prototype.parse = function(arg,
   else if (arg.text === 'tomorrow') {
     value = new Date().setDate(new Date().getDate() + 1);
   }
   else {
     var millis = Date.parse(arg.text);
 
     if (isNaN(millis)) {
       var msg = l10n.lookupFormat('typesDateNan', [ arg.text ]);
-      return Promise.resolve(new Conversion(undefined, arg, Status.ERROR, msg));
+      return promise.resolve(new Conversion(undefined, arg, Status.ERROR, msg));
     }
 
     value = new Date(millis);
   }
 
-  return Promise.resolve(new Conversion(value, arg));
+  return promise.resolve(new Conversion(value, arg));
 };
 
 DateType.prototype.decrement = function(value, context) {
   if (!isDate(value)) {
     return new Date();
   }
 
   var newValue = new Date(value);
@@ -4143,17 +4143,17 @@ exports.shutdown = function() {
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 define('gcli/types/javascript', ['require', 'exports', 'module' , 'util/promise', 'util/l10n', 'gcli/types'], function(require, exports, module) {
 
 'use strict';
 
-var Promise = require('util/promise');
+var promise = require('util/promise');
 var l10n = require('util/l10n');
 var types = require('gcli/types');
 
 var Conversion = types.Conversion;
 var Type = types.Type;
 var Status = types.Status;
 
 
@@ -4222,110 +4222,110 @@ JavascriptType.prototype.stringify = fun
 JavascriptType.MAX_COMPLETION_MATCHES = 10;
 
 JavascriptType.prototype.parse = function(arg, context) {
   var typed = arg.text;
   var scope = globalObject;
 
   // No input is undefined
   if (typed === '') {
-    return Promise.resolve(new Conversion(undefined, arg, Status.INCOMPLETE));
+    return promise.resolve(new Conversion(undefined, arg, Status.INCOMPLETE));
   }
   // Just accept numbers
   if (!isNaN(parseFloat(typed)) && isFinite(typed)) {
-    return Promise.resolve(new Conversion(typed, arg));
+    return promise.resolve(new Conversion(typed, arg));
   }
   // Just accept constants like true/false/null/etc
   if (typed.trim().match(/(null|undefined|NaN|Infinity|true|false)/)) {
-    return Promise.resolve(new Conversion(typed, arg));
+    return promise.resolve(new Conversion(typed, arg));
   }
 
   // Analyze the input text and find the beginning of the last part that
   // should be completed.
   var beginning = this._findCompletionBeginning(typed);
 
   // There was an error analyzing the string.
   if (beginning.err) {
-    return Promise.resolve(new Conversion(typed, arg, Status.ERROR, beginning.err));
+    return promise.resolve(new Conversion(typed, arg, Status.ERROR, beginning.err));
   }
 
   // If the current state is ParseState.COMPLEX, then we can't do completion.
   // so bail out now
   if (beginning.state === ParseState.COMPLEX) {
-    return Promise.resolve(new Conversion(typed, arg));
+    return promise.resolve(new Conversion(typed, arg));
   }
 
   // If the current state is not ParseState.NORMAL, then we are inside of a
   // string which means that no completion is possible.
   if (beginning.state !== ParseState.NORMAL) {
-    return Promise.resolve(new Conversion(typed, arg, Status.INCOMPLETE, ''));
+    return promise.resolve(new Conversion(typed, arg, Status.INCOMPLETE, ''));
   }
 
   var completionPart = typed.substring(beginning.startPos);
   var properties = completionPart.split('.');
   var matchProp;
   var prop = undefined;
 
   if (properties.length > 1) {
     matchProp = properties.pop().trimLeft();
     for (var i = 0; i < properties.length; i++) {
       prop = properties[i].trim();
 
       // We can't complete on null.foo, so bail out
       if (scope == null) {
-        return Promise.resolve(new Conversion(typed, arg, Status.ERROR,
+        return promise.resolve(new Conversion(typed, arg, Status.ERROR,
                                         l10n.lookup('jstypeParseScope')));
       }
 
       if (prop === '') {
-        return Promise.resolve(new Conversion(typed, arg, Status.INCOMPLETE, ''));
+        return promise.resolve(new Conversion(typed, arg, Status.INCOMPLETE, ''));
       }
 
       // Check if prop is a getter function on 'scope'. Functions can change
       // other stuff so we can't execute them to get the next object. Stop here.
       if (this._isSafeProperty(scope, prop)) {
-        return Promise.resolve(new Conversion(typed, arg));
+        return promise.resolve(new Conversion(typed, arg));
       }
 
       try {
         scope = scope[prop];
       }
       catch (ex) {
         // It would be nice to be able to report this error in some way but
         // as it can happen just when someone types '{sessionStorage.', it
         // almost doesn't really count as an error, so we ignore it
-        return Promise.resolve(new Conversion(typed, arg, Status.VALID, ''));
+        return promise.resolve(new Conversion(typed, arg, Status.VALID, ''));
       }
     }
   }
   else {
     matchProp = properties[0].trimLeft();
   }
 
   // If the reason we just stopped adjusting the scope was a non-simple string,
   // then we're not sure if the input is valid or invalid, so accept it
   if (prop && !prop.match(/^[0-9A-Za-z]*$/)) {
-    return Promise.resolve(new Conversion(typed, arg));
+    return promise.resolve(new Conversion(typed, arg));
   }
 
   // However if the prop was a simple string, it is an error
   if (scope == null) {
     var message = l10n.lookupFormat('jstypeParseMissing', [ prop ]);
-    return Promise.resolve(new Conversion(typed, arg, Status.ERROR, message));
+    return promise.resolve(new Conversion(typed, arg, Status.ERROR, message));
   }
 
   // If the thing we're looking for isn't a simple string, then we're not going
   // to find it, but we're not sure if it's valid or invalid, so accept it
   if (!matchProp.match(/^[0-9A-Za-z]*$/)) {
-    return Promise.resolve(new Conversion(typed, arg));
+    return promise.resolve(new Conversion(typed, arg));
   }
 
   // Skip Iterators and Generators.
   if (this._isIteratorOrGenerator(scope)) {
-    return Promise.resolve(new Conversion(typed, arg));
+    return promise.resolve(new Conversion(typed, arg));
   }
 
   var matchLen = matchProp.length;
   var prefix = matchLen === 0 ? typed : typed.slice(0, -matchLen);
   var status = Status.INCOMPLETE;
   var message = '';
 
   // We really want an array of matches (for sorting) but it's easier to
@@ -4354,17 +4354,17 @@ JavascriptType.prototype.parse = functio
         }
       });
 
       distUpPrototypeChain++;
       root = Object.getPrototypeOf(root);
     }
   }
   catch (ex) {
-    return Promise.resolve(new Conversion(typed, arg, Status.INCOMPLETE, ''));
+    return promise.resolve(new Conversion(typed, arg, Status.INCOMPLETE, ''));
   }
 
   // Convert to an array for sorting, and while we're at it, note if we got
   // an exact match so we know that this input is valid
   matches = Object.keys(matches).map(function(property) {
     if (property === matchProp) {
       status = Status.VALID;
     }
@@ -4448,18 +4448,18 @@ JavascriptType.prototype.parse = functio
     message = l10n.lookupFormat('jstypeParseMissing', [ matchProp ]);
   }
 
   // If the match is the only one possible, and its VALID, predict nothing
   if (predictions.length === 1 && status === Status.VALID) {
     predictions = [];
   }
 
-  return Promise.resolve(new Conversion(typed, arg, status, message,
-                                  Promise.resolve(predictions)));
+  return promise.resolve(new Conversion(typed, arg, status, message,
+                                  promise.resolve(predictions)));
 };
 
 /**
  * Does the given property have a prefix that indicates that it is vendor
  * specific?
  */
 function isVendorPrefixed(name) {
   return name.indexOf('moz') === 0 ||
@@ -4707,17 +4707,17 @@ exports.JavascriptType = JavascriptType;
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 define('gcli/types/node', ['require', 'exports', 'module' , 'util/promise', 'util/host', 'util/l10n', 'gcli/types', 'gcli/argument'], function(require, exports, module) {
 
 'use strict';
 
-var Promise = require('util/promise');
+var promise = require('util/promise');
 var host = require('util/host');
 var l10n = require('util/l10n');
 var types = require('gcli/types');
 var Type = require('gcli/types').Type;
 var Status = require('gcli/types').Status;
 var Conversion = require('gcli/types').Conversion;
 var BlankArgument = require('gcli/argument').BlankArgument;
 
@@ -4791,46 +4791,46 @@ NodeType.prototype.stringify = function(
   if (value == null) {
     return '';
   }
   return value.__gcliQuery || 'Error';
 };
 
 NodeType.prototype.parse = function(arg, context) {
   if (arg.text === '') {
-    return Promise.resolve(new Conversion(undefined, arg, Status.INCOMPLETE));
+    return promise.resolve(new Conversion(undefined, arg, Status.INCOMPLETE));
   }
 
   var nodes;
   try {
     nodes = doc.querySelectorAll(arg.text);
   }
   catch (ex) {
-    return Promise.resolve(new Conversion(undefined, arg, Status.ERROR,
+    return promise.resolve(new Conversion(undefined, arg, Status.ERROR,
                                           l10n.lookup('nodeParseSyntax')));
   }
 
   if (nodes.length === 0) {
-    return Promise.resolve(new Conversion(undefined, arg, Status.INCOMPLETE,
+    return promise.resolve(new Conversion(undefined, arg, Status.INCOMPLETE,
                                           l10n.lookup('nodeParseNone')));
   }
 
   if (nodes.length === 1) {
     var node = nodes.item(0);
     node.__gcliQuery = arg.text;
 
     host.flashNodes(node, true);
 
-    return Promise.resolve(new Conversion(node, arg, Status.VALID, ''));
+    return promise.resolve(new Conversion(node, arg, Status.VALID, ''));
   }
 
   host.flashNodes(nodes, false);
 
   var message = l10n.lookupFormat('nodeParseMultiple', [ nodes.length ]);
-  return Promise.resolve(new Conversion(undefined, arg, Status.ERROR, message));
+  return promise.resolve(new Conversion(undefined, arg, Status.ERROR, message));
 };
 
 NodeType.prototype.name = 'node';
 
 
 
 /**
  * A CSS expression that refers to a node list.
@@ -4862,35 +4862,35 @@ NodeListType.prototype.stringify = funct
   if (value == null) {
     return '';
   }
   return value.__gcliQuery || 'Error';
 };
 
 NodeListType.prototype.parse = function(arg, context) {
   if (arg.text === '') {
-    return Promise.resolve(new Conversion(undefined, arg, Status.INCOMPLETE));
+    return promise.resolve(new Conversion(undefined, arg, Status.INCOMPLETE));
   }
 
   var nodes;
   try {
     nodes = doc.querySelectorAll(arg.text);
   }
   catch (ex) {
-    return Promise.resolve(new Conversion(undefined, arg, Status.ERROR,
+    return promise.resolve(new Conversion(undefined, arg, Status.ERROR,
                                     l10n.lookup('nodeParseSyntax')));
   }
 
   if (nodes.length === 0 && !this.allowEmpty) {
-    return Promise.resolve(new Conversion(undefined, arg, Status.INCOMPLETE,
+    return promise.resolve(new Conversion(undefined, arg, Status.INCOMPLETE,
                                     l10n.lookup('nodeParseNone')));
   }
 
   host.flashNodes(nodes, false);
-  return Promise.resolve(new Conversion(nodes, arg, Status.VALID, ''));
+  return promise.resolve(new Conversion(nodes, arg, Status.VALID, ''));
 };
 
 NodeListType.prototype.name = 'nodelist';
 
 
 });
 /*
  * Copyright 2012, Mozilla Foundation and contributors
@@ -4960,17 +4960,17 @@ exports.exec = function(execSpec) {
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 define('gcli/types/resource', ['require', 'exports', 'module' , 'util/promise', 'gcli/types', 'gcli/types/selection'], function(require, exports, module) {
 
 'use strict';
 
-var Promise = require('util/promise');
+var promise = require('util/promise');
 var types = require('gcli/types');
 var SelectionType = require('gcli/types/selection').SelectionType;
 
 
 /**
  * Registration and de-registration.
  */
 exports.startup = function() {
@@ -5211,17 +5211,17 @@ ResourceType.prototype.getLookup = funct
   var resources = [];
   if (this.include !== Resource.TYPE_SCRIPT) {
     Array.prototype.push.apply(resources, CssResource._getAllStyles());
   }
   if (this.include !== Resource.TYPE_CSS) {
     Array.prototype.push.apply(resources, ScriptResource._getAllScripts());
   }
 
-  return Promise.resolve(resources.map(function(resource) {
+  return promise.resolve(resources.map(function(resource) {
     return { name: resource.name, value: resource };
   }));
 };
 
 ResourceType.prototype.name = 'resource';
 
 
 /**
@@ -5855,17 +5855,17 @@ define('util/domtemplate', ['require', '
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 define('gcli/cli', ['require', 'exports', 'module' , 'util/promise', 'util/util', 'util/l10n', 'gcli/ui/view', 'gcli/canon', 'gcli/types', 'gcli/argument'], function(require, exports, module) {
 
 'use strict';
 
-var Promise = require('util/promise');
+var promise = require('util/promise');
 var util = require('util/util');
 var l10n = require('util/l10n');
 
 var view = require('gcli/ui/view');
 var canon = require('gcli/canon');
 var CommandOutputManager = require('gcli/canon').CommandOutputManager;
 
 var Status = require('gcli/types').Status;
@@ -5976,17 +5976,17 @@ Assignment.prototype.getPredictions = fu
  * @param index The index of the prediction to choose
  */
 Assignment.prototype.getPredictionAt = function(index) {
   if (index == null) {
     index = 0;
   }
 
   if (this.isInName()) {
-    return Promise.resolve(undefined);
+    return promise.resolve(undefined);
   }
 
   return this.getPredictions().then(function(predictions) {
     if (predictions.length === 0) {
       return undefined;
     }
 
     index = index % predictions.length;
@@ -6282,17 +6282,17 @@ var legacy = false;
 /**
  * Functions and data related to the execution of a command
  */
 Object.defineProperty(Requisition.prototype, 'executionContext', {
   get: function() {
     if (this._executionContext == null) {
       this._executionContext = {
         defer: function() {
-          return Promise.defer();
+          return promise.defer();
         },
         typedData: function(type, data) {
           return {
             isTypedData: true,
             data: data,
             type: type
           };
         },
@@ -6344,17 +6344,17 @@ Object.defineProperty(Requisition.protot
 /**
  * Functions and data related to the conversion of the output of a command
  */
 Object.defineProperty(Requisition.prototype, 'conversionContext', {
   get: function() {
     if (this._conversionContext == null) {
       this._conversionContext = {
         defer: function() {
-          return Promise.defer();
+          return promise.defer();
         },
 
         createView: view.createView,
         exec: this.exec.bind(this),
         update: this.update.bind(this),
         updateExec: this.updateExec.bind(this)
       };
 
@@ -6637,17 +6637,17 @@ Requisition.prototype.setAssignment = fu
   }
   else {
     var parsed = assignment.param.type.parse(arg, this.executionContext);
     return parsed.then(function(conversion) {
       setAssignmentInternal(conversion);
     }.bind(this));
   }
 
-  return Promise.resolve(undefined);
+  return promise.resolve(undefined);
 };
 
 /**
  * Reset all the assignments to their default values
  */
 Requisition.prototype.setBlankArguments = function() {
   this.getAssignments().forEach(function(assignment) {
     var promise = this.setAssignment(assignment, null, { skipArgUpdate: true });
@@ -6707,34 +6707,34 @@ Requisition.prototype.complete = functio
       }
     }
     else {
       // Mutate this argument to hold the completion
       var arg = assignment.arg.beget({
         text: prediction.name,
         dontQuote: (assignment === this.commandAssignment)
       });
-      var promise = this.setAssignment(assignment, arg);
+      var assignmentPromise = this.setAssignment(assignment, arg);
 
       if (!prediction.incomplete) {
-        promise = promise.then(function() {
+        assignmentPromise = assignmentPromise.then(function() {
           // The prediction is complete, add a space to let the user move-on
           return this._addSpace(assignment).then(function() {
             // Bug 779443 - Remove or explain the re-parse
             if (assignment instanceof UnassignedAssignment) {
               return this.update(this.toString());
             }
           }.bind(this));
         }.bind(this));
       }
 
-      outstanding.push(promise);
-    }
-
-    return Promise.all(outstanding).then(function() {
+      outstanding.push(assignmentPromise);
+    }
+
+    return promise.all(outstanding).then(function() {
       this.onTextChange();
       this.onTextChange.resumeFire();
     }.bind(this));
   }.bind(this));
 };
 
 /**
  * A test method to check that all args are assigned in some way
@@ -6753,17 +6753,17 @@ Requisition.prototype._assertArgsAssigne
  * @param assignment The assignment to which to append the space
  */
 Requisition.prototype._addSpace = function(assignment) {
   var arg = assignment.conversion.arg.beget({ suffixSpace: true });
   if (arg !== assignment.conversion.arg) {
     return this.setAssignment(assignment, arg);
   }
   else {
-    return Promise.resolve(undefined);
+    return promise.resolve(undefined);
   }
 };
 
 /**
  * Replace the current value with the lower value if such a concept exists.
  */
 Requisition.prototype.decrement = function(assignment) {
   var replacement = assignment.param.type.decrement(assignment.conversion.value,
@@ -7115,17 +7115,17 @@ Requisition.prototype.exec = function(op
       data: ex,
       type: 'error'
     };
     output.complete(data, true);
   };
 
   try {
     var reply = command.exec(args, this.executionContext);
-    Promise.resolve(reply).then(onDone, onError);
+    promise.resolve(reply).then(onDone, onError);
   }
   catch (ex) {
     onError(ex);
   }
 
   this.clear();
   return output;
 };
@@ -7466,41 +7466,41 @@ Requisition.prototype._split = function(
     // Special case: if the user enters { console.log('foo'); } then we need to
     // use the hidden 'eval' command
     conversion = new Conversion(evalCommand, new ScriptArgument());
     return this.setAssignment(this.commandAssignment, conversion, noArgUp);
   }
 
   var argsUsed = 1;
 
-  var promise;
+  var parsePromise;
   var commandType = this.commandAssignment.param.type;
   while (argsUsed <= args.length) {
     var arg = (argsUsed === 1) ?
               args[0] :
               new MergedArgument(args, 0, argsUsed);
 
     // Making the commandType.parse() promise as synchronous is OK because we
     // know that commandType is a synchronous type.
 
     if (this.prefix != null && this.prefix != '') {
       var prefixArg = new Argument(this.prefix, '', ' ');
       var prefixedArg = new MergedArgument([ prefixArg, arg ]);
 
-      promise = commandType.parse(prefixedArg, this.executionContext);
-      conversion = util.synchronize(promise);
+      parsePromise = commandType.parse(prefixedArg, this.executionContext);
+      conversion = util.synchronize(parsePromise);
 
       if (conversion.value == null) {
-        promise = commandType.parse(arg, this.executionContext);
-        conversion = util.synchronize(promise);
+        parsePromise = commandType.parse(arg, this.executionContext);
+        conversion = util.synchronize(parsePromise);
       }
     }
     else {
-      promise = commandType.parse(arg, this.executionContext);
-      conversion = util.synchronize(promise);
+      parsePromise = commandType.parse(arg, this.executionContext);
+      conversion = util.synchronize(parsePromise);
     }
 
     // We only want to carry on if this command is a parent command,
     // which means that there is a commandAssignment, but not one with
     // an exec function.
     if (!conversion.value || conversion.value.exec) {
       break;
     }
@@ -7541,39 +7541,39 @@ Requisition.prototype._assign = function
   // See comment in _split. Avoid multiple updates
   var noArgUp = { skipArgUpdate: true };
 
   this._unassigned = [];
   var outstanding = [];
 
   if (!this.commandAssignment.value) {
     this._addUnassignedArgs(args);
-    return Promise.all(outstanding);
+    return promise.all(outstanding);
   }
 
   if (args.length === 0) {
     this.setBlankArguments();
-    return Promise.all(outstanding);
+    return promise.all(outstanding);
   }
 
   // Create an error if the command does not take parameters, but we have
   // been given them ...
   if (this.assignmentCount === 0) {
     this._addUnassignedArgs(args);
-    return Promise.all(outstanding);
+    return promise.all(outstanding);
   }
 
   // Special case: if there is only 1 parameter, and that's of type
   // text, then we put all the params into the first param
   if (this.assignmentCount === 1) {
     var assignment = this.getAssignment(0);
     if (assignment.param.type.name === 'string') {
       var arg = (args.length === 1) ? args[0] : new MergedArgument(args);
       outstanding.push(this.setAssignment(assignment, arg, noArgUp));
-      return Promise.all(outstanding);
+      return promise.all(outstanding);
     }
   }
 
   // Positional arguments can still be specified by name, but if they are
   // then we need to ignore them when working them out positionally
   var unassignedParams = this.getParameterNames();
 
   // We collect the arguments used in arrays here before assigning
@@ -7670,17 +7670,17 @@ Requisition.prototype._assign = function
   Object.keys(arrayArgs).forEach(function(name) {
     var assignment = this.getAssignment(name);
     outstanding.push(this.setAssignment(assignment, arrayArgs[name], noArgUp));
   }, this);
 
   // What's left is can't be assigned, but we need to extract
   this._addUnassignedArgs(args);
 
-  return Promise.all(outstanding);
+  return promise.all(outstanding);
 };
 
 exports.Requisition = Requisition;
 
 /**
  * A simple object to hold information about the output of a command
  */
 function Output(options) {
@@ -7692,17 +7692,17 @@ function Output(options) {
   this.hidden = options.hidden === true ? true : false;
 
   this.type = undefined;
   this.data = undefined;
   this.completed = false;
   this.error = false;
   this.start = new Date();
 
-  this._deferred = Promise.defer();
+  this._deferred = promise.defer();
   this.promise = this._deferred.promise;
 
   this.onClose = util.createEvent('Output.onClose');
 }
 
 /**
  * Called when there is data to display, and the command has finished executing
  * See changed() for details on parameters.
@@ -8493,34 +8493,34 @@ ArrayField.prototype.setConversion = fun
     this._onAdd(null, subConversion);
   }, this);
 };
 
 ArrayField.prototype.getConversion = function() {
   var conversions = [];
   var arrayArg = new ArrayArgument();
   for (var i = 0; i < this.members.length; i++) {
-    Promise.resolve(this.members[i].field.getConversion()).then(function(conversion) {
+    promise.resolve(this.members[i].field.getConversion()).then(function(conversion) {
       conversions.push(conversion);
       arrayArg.addArgument(conversion.arg);
     }.bind(this), util.errorHandler);
   }
   return new ArrayConversion(conversions, arrayArg);
 };
 
 ArrayField.prototype._onAdd = function(ev, subConversion) {
   // <div class=gcliArrayMbr save="${element}">
   var element = util.createElement(this.document, 'div');
   element.classList.add('gcli-array-member');
   this.container.appendChild(element);
 
   // ${field.element}
   var field = fields.getField(this.type.subtype, this.options);
   field.onFieldChange.add(function() {
-    Promise.resolve(this.getConversion()).then(function(conversion) {
+    promise.resolve(this.getConversion()).then(function(conversion) {
       this.onFieldChange({ conversion: conversion });
       this.setMessage(conversion.message);
     }.bind(this), util.errorHandler);
   }, this);
 
   if (subConversion) {
     field.setConversion(subConversion);
   }
@@ -8567,17 +8567,17 @@ ArrayField.prototype._onAdd = function(e
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 define('gcli/ui/fields', ['require', 'exports', 'module' , 'util/promise', 'util/util'], function(require, exports, module) {
 
 'use strict';
 
-var Promise = require('util/promise');
+var promise = require('util/promise');
 var util = require('util/util');
 var KeyEvent = require('util/util').KeyEvent;
 
 /**
  * A Field is a way to get input for a single parameter.
  * This class is designed to be inherited from. It's important that all
  * subclasses have a similar constructor signature because they are created
  * via getField(...)
@@ -8648,17 +8648,17 @@ Field.prototype.setMessage = function(me
   }
 };
 
 /**
  * Method to be called by subclasses when their input changes, which allows us
  * to properly pass on the onFieldChange event.
  */
 Field.prototype.onInputChange = function(ev) {
-  Promise.resolve(this.getConversion()).then(function(conversion) {
+  promise.resolve(this.getConversion()).then(function(conversion) {
     this.onFieldChange({ conversion: conversion });
     this.setMessage(conversion.message);
 
     if (ev.keyCode === KeyEvent.DOM_VK_RETURN) {
       this.requisition.exec();
     }
   }.bind(this), util.errorHandler);
 };
@@ -8817,17 +8817,17 @@ exports.addField(BlankField);
  * limitations under the License.
  */
 
 define('gcli/ui/fields/javascript', ['require', 'exports', 'module' , 'util/util', 'util/promise', 'gcli/types', 'gcli/argument', 'gcli/ui/fields/menu', 'gcli/ui/fields'], function(require, exports, module) {
 
 'use strict';
 
 var util = require('util/util');
-var Promise = require('util/promise');
+var promise = require('util/promise');
 
 var Status = require('gcli/types').Status;
 var Conversion = require('gcli/types').Conversion;
 var ScriptArgument = require('gcli/argument').ScriptArgument;
 
 var Menu = require('gcli/ui/fields/menu').Menu;
 var Field = require('gcli/ui/fields').Field;
 var fields = require('gcli/ui/fields');
@@ -8926,25 +8926,25 @@ JavascriptField.prototype.setConversion 
       }
     }, this);
     this.menu.show(items);
   }.bind(this), util.errorHandler);
 };
 
 JavascriptField.prototype.itemClicked = function(ev) {
   var parsed = this.type.parse(ev.arg, this.requisition.executionContext);
-  Promise.resolve(parsed).then(function(conversion) {
+  promise.resolve(parsed).then(function(conversion) {
     this.onFieldChange({ conversion: conversion });
     this.setMessage(conversion.message);
   }.bind(this), util.errorHandler);
 };
 
 JavascriptField.prototype.onInputChange = function(ev) {
   this.item = ev.currentTarget.item;
-  Promise.resolve(this.getConversion()).then(function(conversion) {
+  promise.resolve(this.getConversion()).then(function(conversion) {
     this.onFieldChange({ conversion: conversion });
     this.setMessage(conversion.message);
   }.bind(this), util.errorHandler);
 };
 
 JavascriptField.prototype.getConversion = function() {
   // This tweaks the prefix/suffix of the argument to fit
   this.arg = new ScriptArgument(this.input.value, '{ ', ' }');
@@ -9213,17 +9213,17 @@ define("text!gcli/ui/fields/menu.html", 
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 define('gcli/ui/fields/selection', ['require', 'exports', 'module' , 'util/promise', 'util/util', 'util/l10n', 'gcli/argument', 'gcli/types', 'gcli/ui/fields/menu', 'gcli/ui/fields'], function(require, exports, module) {
 
 'use strict';
 
-var Promise = require('util/promise');
+var promise = require('util/promise');
 var util = require('util/util');
 var l10n = require('util/l10n');
 
 var Argument = require('gcli/argument').Argument;
 var Status = require('gcli/types').Status;
 var Conversion = require('gcli/types').Conversion;
 
 var Menu = require('gcli/ui/fields/menu').Menu;
@@ -9262,17 +9262,17 @@ function SelectionField(type, options) {
   this.items = [];
 
   this.element = util.createElement(this.document, 'select');
   this.element.classList.add('gcli-field');
   this._addOption({
     name: l10n.lookupFormat('fieldSelectionSelect', [ options.name ])
   });
 
-  Promise.resolve(this.type.getLookup()).then(function(lookup) {
+  promise.resolve(this.type.getLookup()).then(function(lookup) {
     lookup.forEach(this._addOption, this);
   }.bind(this), util.errorHandler);
 
   this.onInputChange = this.onInputChange.bind(this);
   this.element.addEventListener('change', this.onInputChange, false);
 
   this.onFieldChange = util.createEvent('SelectionField.onFieldChange');
 }
@@ -9368,25 +9368,25 @@ SelectionTooltipField.prototype.setConve
       return prediction.value.description ? prediction.value : prediction;
     }, this);
     this.menu.show(items, conversion.arg.text);
   }.bind(this), util.errorHandler);
 };
 
 SelectionTooltipField.prototype.itemClicked = function(ev) {
   var parsed = this.type.parse(ev.arg, this.requisition.executionContext);
-  Promise.resolve(parsed).then(function(conversion) {
+  promise.resolve(parsed).then(function(conversion) {
     this.onFieldChange({ conversion: conversion });
     this.setMessage(conversion.message);
   }.bind(this), util.errorHandler);
 };
 
 SelectionTooltipField.prototype.onInputChange = function(ev) {
   this.item = ev.currentTarget.item;
-  Promise.resolve(this.getConversion()).then(function(conversion) {
+  promise.resolve(this.getConversion()).then(function(conversion) {
     this.onFieldChange({ conversion: conversion });
     this.setMessage(conversion.message);
   }.bind(this), util.errorHandler);
 };
 
 SelectionTooltipField.prototype.getConversion = function() {
   // This tweaks the prefix/suffix of the argument to fit
   this.arg = this.arg.beget({ text: this.input.value });
@@ -9610,17 +9610,17 @@ exports.shutdown = function() {
 
 define('util/connect/connector', ['require', 'exports', 'module' , 'util/promise'], function(require, exports, module) {
 
 'use strict';
 
 var debuggerSocketConnect = Components.utils.import('resource://gre/modules/devtools/dbg-client.jsm', {}).debuggerSocketConnect;
 var DebuggerClient = Components.utils.import('resource://gre/modules/devtools/dbg-client.jsm', {}).DebuggerClient;
 
-var Promise = require('util/promise');
+var promise = require('util/promise');
 
 /**
  * What port should we use by default?
  */
 Object.defineProperty(exports, 'defaultPort', {
   get: function() {
     var Services = Components.utils.import('resource://gre/modules/Services.jsm', {}).Services;
     try {
@@ -9664,17 +9664,17 @@ function Connection(prefix, host, port) 
 
 /**
  * Setup socket.io, retrieve the list of remote commands and register them with
  * the local canon.
  * @return a promise which resolves (to undefined) when the connection is made
  * or is rejected (with an error message) if the connection fails
  */
 Connection.prototype.connect = function() {
-  var deferred = Promise.defer();
+  var deferred = promise.defer();
 
   this.transport = debuggerSocketConnect(this.host, this.port);
   this.client = new DebuggerClient(this.transport);
 
   this.client.connect(function() {
     this.client.listTabs(function(response) {
       this.actor = response.gcliActor;
       deferred.resolve();
@@ -9684,17 +9684,17 @@ Connection.prototype.connect = function(
   return deferred.promise;
 };
 
 /**
  * Retrieve the list of remote commands.
  * @return a promise of an array of commandSpecs
  */
 Connection.prototype.getCommandSpecs = function() {
-  var deferred = Promise.defer();
+  var deferred = promise.defer();
 
   var request = { to: this.actor, type: 'getCommandSpecs' };
 
   this.client.request(request, function(response) {
     deferred.resolve(response.commandSpecs);
   });
 
   return deferred.promise;
@@ -9718,17 +9718,17 @@ Connection.prototype.execute = function(
 };
 
 exports.disconnectSupportsForce = false;
 
 /**
  * Kill this connection
  */
 Connection.prototype.disconnect = function(force) {
-  var deferred = Promise.defer();
+  var deferred = promise.defer();
 
   this.client.close(function() {
     deferred.resolve();
   });
 
   return request.promise;
 };
 
@@ -9740,17 +9740,17 @@ function Request(actor, typed, args) {
   this.json = {
     to: actor,
     type: 'execute',
     typed: typed,
     args: args,
     requestId: 'id-' + Request._nextRequestId++,
   };
 
-  this._deferred = Promise.defer();
+  this._deferred = promise.defer();
   this.promise = this._deferred.promise;
 }
 
 Request._nextRequestId = 0;
 
 /**
  * Called by the connection when a remote command has finished executing
  * @param error boolean indicating output state
@@ -10064,17 +10064,17 @@ function getSubCommands(command) {
  * limitations under the License.
  */
 
 define('gcli/converters', ['require', 'exports', 'module' , 'util/util', 'util/promise'], function(require, exports, module) {
 
 'use strict';
 
 var util = require('util/util');
-var Promise = require('util/promise');
+var promise = require('util/promise');
 
 // It's probably easiest to read this bottom to top
 
 /**
  * Best guess at creating a DOM element from random data
  */
 var fallbackDomConverter = {
   from: '*',
@@ -10337,19 +10337,19 @@ function getFallbackConverter(from, to) 
  * @param data The object to convert
  * @param from The type of the data right now
  * @param to The type that we would like the data in
  * @param conversionContext An execution context (i.e. simplified requisition) which is
  * often required for access to a document, or createView function
  */
 exports.convert = function(data, from, to, conversionContext) {
   if (from === to) {
-    return Promise.resolve(data);
-  }
-  return Promise.resolve(getConverter(from, to).exec(data, conversionContext));
+    return promise.resolve(data);
+  }
+  return promise.resolve(getConverter(from, to).exec(data, conversionContext));
 };
 
 exports.addConverter(viewDomConverter);
 exports.addConverter(viewStringConverter);
 exports.addConverter(terminalDomConverter);
 exports.addConverter(terminalStringConverter);
 exports.addConverter(stringDomConverter);
 exports.addConverter(numberDomConverter);
@@ -10868,27 +10868,27 @@ exports.FFDisplay = FFDisplay;
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 define('gcli/ui/inputter', ['require', 'exports', 'module' , 'util/promise', 'util/util', 'gcli/types', 'gcli/history', 'text!gcli/ui/inputter.css'], function(require, exports, module) {
 
 'use strict';
 
-var Promise = require('util/promise');
+var promise = require('util/promise');
 var util = require('util/util');
 var KeyEvent = require('util/util').KeyEvent;
 
 var Status = require('gcli/types').Status;
 var History = require('gcli/history').History;
 
 var inputterCss = require('text!gcli/ui/inputter.css');
 
 
-var RESOLVED = Promise.resolve(undefined);
+var RESOLVED = promise.resolve(undefined);
 
 /**
  * A wrapper to take care of the functions concerning an input element
  * @param options Object containing user customization properties, including:
  * - scratchpad (default=none)
  * - promptWidth (default=22px)
  * @param components Object that links to other UI components. GCLI provided:
  * - requisition
@@ -11558,17 +11558,17 @@ define("text!gcli/ui/inputter.css", [], 
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 define('gcli/ui/completer', ['require', 'exports', 'module' , 'util/promise', 'util/util', 'util/domtemplate', 'text!gcli/ui/completer.html'], function(require, exports, module) {
 
 'use strict';
 
-var Promise = require('util/promise');
+var promise = require('util/promise');
 var util = require('util/util');
 var domtemplate = require('util/domtemplate');
 
 var completerHtml = require('text!gcli/ui/completer.html');
 
 /**
  * Completer is an 'input-like' element that sits  an input element annotating
  * it with visual goodness.
@@ -11662,36 +11662,36 @@ Completer.prototype.update = function(ev
 };
 
 /**
  * Calculate the properties required by the template process for completer.html
  */
 Completer.prototype._getCompleterTemplateData = function() {
   // Some of the data created by this function can be calculated synchronously
   // but other parts depend on predictions which are asynchronous.
-  var promisedDirectTabText = Promise.defer();
-  var promisedArrowTabText = Promise.defer();
-  var promisedEmptyParameters = Promise.defer();
+  var promisedDirectTabText = promise.defer();
+  var promisedArrowTabText = promise.defer();
+  var promisedEmptyParameters = promise.defer();
 
   var input = this.inputter.getInputState();
   var current = this.requisition.getAssignmentAt(input.cursor.start);
   var predictionPromise = undefined;
 
   if (input.typed.trim().length !== 0) {
     predictionPromise = current.getPredictionAt(this.choice);
   }
 
   // If anything goes wrong, we pass the error on to all the child promises
   var onError = function(ex) {
     promisedDirectTabText.reject(ex);
     promisedArrowTabText.reject(ex);
     promisedEmptyParameters.reject(ex);
   };
 
-  Promise.resolve(predictionPromise).then(function(prediction) {
+  promise.resolve(predictionPromise).then(function(prediction) {
     // directTabText is for when the current input is a prefix of the completion
     // arrowTabText is for when we need to use an -> to show what will be used
     var directTabText = '';
     var arrowTabText = '';
     var emptyParameters = [];
 
     if (input.typed.trim().length !== 0) {
       var cArg = current.arg;
--- a/toolkit/devtools/server/actors/webapps.js
+++ b/toolkit/devtools/server/actors/webapps.js
@@ -24,17 +24,17 @@ function WebappsActor(aConnection) {
   debug("init");
   // Load actor dependencies lazily as this actor require extra environnement
   // preparation to work (like have a profile setup in xpcshell tests)
 
   Cu.import("resource://gre/modules/Webapps.jsm");
   Cu.import("resource://gre/modules/AppsUtils.jsm");
   Cu.import("resource://gre/modules/FileUtils.jsm");
   Cu.import('resource://gre/modules/Services.jsm');
-  Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
+  let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js").Promise;
 }
 
 WebappsActor.prototype = {
   actorPrefix: "webapps",
 
   _registerApp: function wa_actorRegisterApp(aApp, aId, aDir) {
     debug("registerApp");
     let reg = DOMApplicationRegistry;
@@ -298,17 +298,17 @@ WebappsActor.prototype = {
     }
 
     return { appId: appId, path: appDir.path }
   },
 
   getAll: function wa_actorGetAll(aRequest) {
     debug("getAll");
 
-    let defer = Promise.defer();
+    let defer = promise.defer();
     let reg = DOMApplicationRegistry;
     reg.getAll(function onsuccess(apps) {
       defer.resolve({ apps: apps });
     });
 
     return defer.promise;
   },
 
@@ -316,17 +316,17 @@ WebappsActor.prototype = {
     debug("uninstall");
 
     let manifestURL = aRequest.manifestURL;
     if (!manifestURL) {
       return { error: "missingParameter",
                message: "missing parameter manifestURL" };
     }
 
-    let defer = Promise.defer();
+    let defer = promise.defer();
     let reg = DOMApplicationRegistry;
     reg.uninstall(
       manifestURL,
       function onsuccess() {
         defer.resolve({});
       },
       function onfailure(reason) {
         defer.resolve({ error: reason });
@@ -340,17 +340,17 @@ WebappsActor.prototype = {
     debug("launch");
 
     let manifestURL = aRequest.manifestURL;
     if (!manifestURL) {
       return { error: "missingParameter",
                message: "missing parameter manifestURL" };
     }
 
-    let defer = Promise.defer();
+    let defer = promise.defer();
     let reg = DOMApplicationRegistry;
     reg.launch(
       aRequest.manifestURL,
       aRequest.startPoint || "",
       function onsuccess() {
         defer.resolve({});
       },
       function onfailure(reason) {
--- a/toolkit/devtools/server/main.js
+++ b/toolkit/devtools/server/main.js
@@ -19,18 +19,18 @@ const DBG_STRINGS_URI = "chrome://global
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 let wantLogging = Services.prefs.getBoolPref("devtools.debugger.log");
 
 Cu.import("resource://gre/modules/jsdebugger.jsm");
 addDebuggerToGlobal(this);
 
-Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
-const { defer, resolve, reject, all } = Promise;
+let promise = Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js").Promise;
+const { defer, resolve, reject, all } = promise;
 
 Cu.import("resource://gre/modules/devtools/SourceMap.jsm");
 
 loadSubScript.call(this, "resource://gre/modules/devtools/DevToolsUtils.js");
 
 function dumpn(str) {
   if (wantLogging) {
     dump("DBG-SERVER: " + str + "\n");
--- a/toolkit/devtools/server/tests/mochitest/inspector-helpers.js
+++ b/toolkit/devtools/server/tests/mochitest/inspector-helpers.js
@@ -74,17 +74,17 @@ function attachURL(url, callback) {
       });
     }
   }, false);
 
   return cleanup;
 }
 
 function promiseOnce(target, event) {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
   target.on(event, (...args) => {
     if (args.length === 1) {
       deferred.resolve(args[0]);
     } else {
       deferred.resolve(args);
     }
   });
   return deferred.promise;
@@ -155,38 +155,38 @@ function assertOwnershipTrees(walker) {
   let clientTree = clientOwnershipTree(walker);
   is(JSON.stringify(clientTree, null, ' '), JSON.stringify(serverTree, null, ' '), "Server and client ownership trees should match.");
 
   return ownershipTreeSize(clientTree.root);
 }
 
 // Verify that an actorID is inaccessible both from the client library and the server.
 function checkMissing(client, actorID) {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
   let front = client.getActor(actorID);
   ok(!front, "Front shouldn't be accessible from the client for actorID: " + actorID);
 
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
   client.request({
     to: actorID,
     type: "request",
   }, response => {
     is(response.error, "noSuchActor", "node list actor should no longer be contactable.");
     deferred.resolve(undefined);
   });
   return deferred.promise;
 }
 
 // Verify that an actorID is accessible both from the client library and the server.
 function checkAvailable(client, actorID) {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
   let front = client.getActor(actorID);
   ok(front, "Front should be accessible from the client for actorID: " + actorID);
 
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
   client.request({
     to: actorID,
     type: "garbageAvailableTest",
   }, response => {
     is(response.error, "unrecognizedPacketType", "node list actor should be contactable.");
     deferred.resolve(undefined);
   });
   return deferred.promise;
@@ -257,17 +257,17 @@ function assertFrameLoad(mutations) {
 // that mutation out of the list
 function assertChildList(mutations) {
   return assertAndStrip(mutations, "Should have had a frame load change.", isChildList);
 }
 
 // Load mutations aren't predictable, so keep accumulating mutations until
 // the one we're looking for shows up.
 function waitForMutation(walker, test, mutations=[]) {
-  let deferred = Promise.defer();
+  let deferred = promise.defer();
   for (let change of mutations) {
     if (test(change)) {
       deferred.resolve(mutations);
     }
   }
 
   walker.once("mutations", newMutations => {
     waitForMutation(walker, test, mutations.concat(newMutations)).then(finalMutations => {
--- a/toolkit/devtools/server/tests/mochitest/test_inspector-changeattrs.html
+++ b/toolkit/devtools/server/tests/mochitest/test_inspector-changeattrs.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <title>Test for Bug </title>
 
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
   <script type="application/javascript;version=1.8" src="inspector-helpers.js"></script>
   <script type="application/javascript;version=1.8">
 Components.utils.import("resource://gre/modules/devtools/Loader.jsm");
 
-const Promise = devtools.require("sdk/core/promise");
+const promise = devtools.require("sdk/core/promise");
 const inspector = devtools.require("devtools/server/actors/inspector");
 
 window.onload = function() {
   SimpleTest.waitForExplicitFinish();
   runNextTest();
 }
 
 var gInspectee = null;
--- a/toolkit/devtools/server/tests/mochitest/test_inspector-changevalue.html
+++ b/toolkit/devtools/server/tests/mochitest/test_inspector-changevalue.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <title>Test for Bug </title>
 
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
   <script type="application/javascript;version=1.8" src="inspector-helpers.js"></script>
   <script type="application/javascript;version=1.8">
 Components.utils.import("resource://gre/modules/devtools/Loader.jsm");
 const Ci = Components.interfaces;
-const Promise = devtools.require("sdk/core/promise");
+const promise = devtools.require("sdk/core/promise");
 const inspector = devtools.require("devtools/server/actors/inspector");
 
 window.onload = function() {
   SimpleTest.waitForExplicitFinish();
   runNextTest();
 }
 
 var gInspectee = null;
--- a/toolkit/devtools/server/tests/mochitest/test_inspector-mutations-attr.html
+++ b/toolkit/devtools/server/tests/mochitest/test_inspector-mutations-attr.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <title>Test for Bug </title>
 
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
   <script type="application/javascript;version=1.8" src="inspector-helpers.js"></script>
   <script type="application/javascript;version=1.8">
 Components.utils.import("resource://gre/modules/devtools/Loader.jsm");
 
-const Promise = devtools.require("sdk/core/promise");
+const promise = devtools.require("sdk/core/promise");
 const inspector = devtools.require("devtools/server/actors/inspector");
 
 window.onload = function() {
   SimpleTest.waitForExplicitFinish();
   runNextTest();
 }
 
 var gInspectee = null;
--- a/toolkit/devtools/server/tests/mochitest/test_inspector-mutations-childlist.html
+++ b/toolkit/devtools/server/tests/mochitest/test_inspector-mutations-childlist.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <title>Test for Bug </title>
 
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
   <script type="application/javascript;version=1.8" src="inspector-helpers.js"></script>
   <script type="application/javascript;version=1.8">
 Components.utils.import("resource://gre/modules/devtools/Loader.jsm");
 
-const Promise = devtools.require("sdk/core/promise");
+const promise = devtools.require("sdk/core/promise");
 const inspector = devtools.require("devtools/server/actors/inspector");
 
 window.onload = function() {
   SimpleTest.waitForExplicitFinish();
   runNextTest();
 }
 
 var gInspectee = null;
@@ -65,17 +65,17 @@ function setParent(nodeSelector, newPare
 
 function loadSelector(selector) {
   return gWalker.querySelectorAll(gWalker.rootNode, selector).then(nodeList => {
     return nodeList.items();
   });
 }
 
 function loadSelectors(selectors) {
-  return Promise.all([loadSelector(sel) for (sel of selectors)]);
+  return promise.all([loadSelector(sel) for (sel of selectors)]);
 }
 
 function doMoves(moves) {
   for (let move of moves) {
     setParent(move[0], move[1]);
   }
 }
 
--- a/toolkit/devtools/server/tests/mochitest/test_inspector-mutations-frameload.html
+++ b/toolkit/devtools/server/tests/mochitest/test_inspector-mutations-frameload.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <title>Test for Bug </title>
 
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
   <script type="application/javascript;version=1.8" src="inspector-helpers.js"></script>
   <script type="application/javascript;version=1.8">
 Components.utils.import("resource://gre/modules/devtools/Loader.jsm");
 
-const Promise = devtools.require("sdk/core/promise");
+const promise = devtools.require("sdk/core/promise");
 const inspector = devtools.require("devtools/server/actors/inspector");
 
 window.onload = function() {
   SimpleTest.waitForExplicitFinish();
   runNextTest();
 }
 
 var gInspectee = null;
--- a/toolkit/devtools/server/tests/mochitest/test_inspector-mutations-value.html
+++ b/toolkit/devtools/server/tests/mochitest/test_inspector-mutations-value.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <title>Test for Bug </title>
 
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
   <script type="application/javascript;version=1.8" src="inspector-helpers.js"></script>
   <script type="application/javascript;version=1.8">
 Components.utils.import("resource://gre/modules/devtools/Loader.jsm");
 
-const Promise = devtools.require("sdk/core/promise");
+const promise = devtools.require("sdk/core/promise");
 const inspector = devtools.require("devtools/server/actors/inspector");
 
 window.onload = function() {
   SimpleTest.waitForExplicitFinish();
   runNextTest();
 }
 
 const testSummaryLength = 10;
--- a/toolkit/devtools/server/tests/mochitest/test_inspector-pseudoclass-lock.html
+++ b/toolkit/devtools/server/tests/mochitest/test_inspector-pseudoclass-lock.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <title>Test for Bug </title>
 
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
   <script type="application/javascript;version=1.8" src="inspector-helpers.js"></script>
   <script type="application/javascript;version=1.8">
 Components.utils.import("resource://gre/modules/devtools/Loader.jsm");
 
-const Promise = devtools.require("sdk/core/promise");
+const promise = devtools.require("sdk/core/promise");
 const inspector = devtools.require("devtools/server/actors/inspector");
 const DOMUtils = Components.classes["@mozilla.org/inspector/dom-utils;1"].
                    getService(Components.interfaces.inIDOMUtils);
 
 const KNOWN_PSEUDOCLASSES = [':hover', ':active', ':focus']
 
 window.onload = function() {
   SimpleTest.waitForExplicitFinish();
--- a/toolkit/devtools/server/tests/mochitest/test_inspector-release.html
+++ b/toolkit/devtools/server/tests/mochitest/test_inspector-release.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <title>Test for Bug </title>
 
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
   <script type="application/javascript;version=1.8" src="inspector-helpers.js"></script>
   <script type="application/javascript;version=1.8">
 Components.utils.import("resource://gre/modules/devtools/Loader.jsm");
 
-const Promise = devtools.require("sdk/core/promise");
+const promise = devtools.require("sdk/core/promise");
 const inspector = devtools.require("devtools/server/actors/inspector");
 
 window.onload = function() {
   SimpleTest.waitForExplicitFinish();
   runNextTest();
 }
 
 var gWalker = null;
--- a/toolkit/devtools/server/tests/mochitest/test_inspector-retain.html
+++ b/toolkit/devtools/server/tests/mochitest/test_inspector-retain.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <title>Test for Bug </title>
 
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
   <script type="application/javascript;version=1.8" src="inspector-helpers.js"></script>
   <script type="application/javascript;version=1.8">
 Components.utils.import("resource://gre/modules/devtools/Loader.jsm");
 
-const Promise = devtools.require("sdk/core/promise");
+const promise = devtools.require("sdk/core/promise");
 const inspector = devtools.require("devtools/server/actors/inspector");
 
 window.onload = function() {
   SimpleTest.waitForExplicitFinish();
   runNextTest();
 }
 
 var gWalker = null;
@@ -115,17 +115,17 @@ addTest(function testRetain() {
 // retain request), because we haven't issued `getMutations` yet.
 addTest(function testWinRace() {
   let front = null;
   promiseDone(gWalker.querySelector(gWalker.rootNode, "#a").then(node => {
     front = node;
     let contentNode = gInspectee.querySelector("#a");
     contentNode.parentNode.removeChild(contentNode);
     // Now wait for that mutation and retain response to come in.
-    return Promise.all([
+    return promise.all([
       gWalker.retainNode(front),
       waitForMutation(gWalker, isChildList)
     ]);
   }).then(() => {
     assertOwnership();
     let clientTree = clientOwnershipTree(gWalker);
     is(gWalker._retainedOrphans.size, 1, "Should have a retained orphan.");
     ok(gWalker._retainedOrphans.has(front), "Should have retained our expected node.");
--- a/toolkit/devtools/server/tests/mochitest/test_inspector-traversal.html
+++ b/toolkit/devtools/server/tests/mochitest/test_inspector-traversal.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <title>Test for Bug </title>
 
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
   <script type="application/javascript;version=1.8" src="inspector-helpers.js"></script>
   <script type="application/javascript;version=1.8">
 Components.utils.import("resource://gre/modules/devtools/Loader.jsm");
 
-const Promise = devtools.require("sdk/core/promise");
+const promise = devtools.require("sdk/core/promise");
 const inspector = devtools.require("devtools/server/actors/inspector");
 
 window.onload = function() {
   SimpleTest.waitForExplicitFinish();
   runNextTest();
 }
 
 var gInspectee = null;
@@ -300,17 +300,17 @@ addTest(function testShortValue() {
   }).then(runNextTest));
 });
 
 addTest(function testReleaseWalker() {
   checkActorIDs.push(gWalker.actorID);
 
   promiseDone(gWalker.release().then(() => {
     let promises = [checkMissing(gClient, id) for (id of checkActorIDs)];
-    return Promise.all(promises)
+    return promise.all(promises)
   }).then(runNextTest));
 });
 
 addTest(function cleanup() {
   delete gWalker;
   delete gInspectee;
   delete gClient;
   runNextTest();