Closed Bug 1388364 Opened 4 years ago Closed 2 years ago

Stop using Promise.jsm in debugger


(DevTools :: Debugger, enhancement, P3)



(firefox57 fix-optional)

Tracking Status
firefox57 --- fix-optional


(Reporter: ochameau, Unassigned)


(Blocks 1 open bug)


Removal of Promise.jsm usage in debugger need particular attention as it uses sync promise is various places.
We should focus on Promise.jsm usages and only that. Getting rid of sync-promises is yet another subject (bug 940537).

Promise.jsm is imported only in 3 places:
$ egrep 'require\("promise"\)' -r devtools/client/debugger/
devtools/client/debugger/content/actions/breakpoints.js:const promise = require("promise");
devtools/client/debugger/content/actions/sources.js:const promise = require("promise");
devtools/client/debugger/panel.js:const promise = require("promise");

Whereas sync-promises are from 2 others, but this ends up exposing that to many files:
$ egrep deprecated-sync -r devtools/client/debugger/
devtools/client/debugger/debugger-controller.js:var promise = require("devtools/shared/deprecated-sync-thenables");
devtools/client/debugger/test/mochitest/head.js:promise = Cu.import("resource://devtools/shared/deprecated-sync-thenables.js", {}).Promise;

So we should only modify the 3 files importing promise module and ignore the rest.
should we do this if it's for client code in the old debugger?
I think deleting the file entirely counts as deleting a use of Promise.jsm... :)
Yes removing old debugger WFM, but I imagine we would like to remove Promise.jsm before that happens.

Replacing Promise.jsm usages from the debugger shouldn't be a big deal.
As said in comment 0 there is only 3 imports, even if panel.js one expose it to the whole document and may introduce more usages.

The main difference between Promise.jsm and DOM Promise is that DOM Promise don't support Promise.defer.
Priority: -- → P3
Product: Firefox → DevTools
This has been fixed by removing the old debugger (bug 1314057), while bug 1502128 is soon going to remove the last usages of deprecated-sync promises by removing the last old debugger tests.
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.