Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 696a298

Browse files
committed
Bug 862360 - Use the exported Promise.all instead of reimplementing it; r=rcampbell
1 parent 0768d0e commit 696a298

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

toolkit/devtools/debugger/server/dbg-script-actors.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ ThreadActor.prototype = {
493493
promises.push(promise);
494494
}
495495

496-
return resolveAll(promises).then(function () {
496+
return all(promises).then(function () {
497497
return { frames: frames };
498498
});
499499
},
@@ -562,7 +562,7 @@ ThreadActor.prototype = {
562562
let originalLocation = this.sources.getOriginalLocation(aLocation.url,
563563
aLocation.line);
564564

565-
return resolveAll([response, originalLocation])
565+
return all([response, originalLocation])
566566
.then(([aResponse, {url, line}]) => {
567567
if (aResponse.actualLocation) {
568568
let actualOrigLocation = this.sources.getOriginalLocation(
@@ -692,8 +692,8 @@ ThreadActor.prototype = {
692692
* Get the script and source lists from the debugger.
693693
*/
694694
_discoverScriptsAndSources: function TA__discoverScriptsAndSources() {
695-
return resolveAll([this._addScript(s)
696-
for (s of this.dbg.findScripts())]);
695+
return all([this._addScript(s)
696+
for (s of this.dbg.findScripts())]);
697697
},
698698

699699
onSources: function TA_onSources(aRequest) {

toolkit/devtools/debugger/server/dbg-server.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ Cu.import("resource://gre/modules/jsdebugger.jsm");
2525
addDebuggerToGlobal(this);
2626

2727
Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
28-
const { defer, resolve, reject } = Promise;
29-
let promisedArray = Promise.promised(Array);
30-
function resolveAll(aPromises) {
31-
return promisedArray.apply(null, aPromises);
32-
};
28+
const { defer, resolve, reject, all } = Promise;
3329

3430
Cu.import("resource://gre/modules/devtools/SourceMap.jsm");
3531

0 commit comments

Comments
 (0)