https://searchfox.org/mozilla-central/source/devtools/shared/defer.js shows how defer is implemented in general. This bug is about rewriting the `defer` usage without the `defer` module, in devtools/server/startup/worker.js. If the promise property isn't used anywhere else: ``` const deferred = defer(); rpcDeferreds[id] = deferred; return deferred.promise; ``` can just be changed to: ``` return new Promise((resolve, reject) => { rpcDeferreds[id] = { resolve, reject }; }); ``` If the promise property is used elsewhere (I'm not sure, but I don't think it is), you can just port the defer.js code inside the worker.js that uses it and adapt the code slightly. Hopefully that's helpful, please let me know if you've got any questions.
Bug 1681888 Comment 6 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
https://searchfox.org/mozilla-central/source/devtools/shared/defer.js shows how defer is implemented in general. This bug is about rewriting `devtools/server/startup/worker.js` to not use the `defer` module. If the promise property isn't used anywhere else: ``` const deferred = defer(); rpcDeferreds[id] = deferred; return deferred.promise; ``` can just be changed to: ``` return new Promise((resolve, reject) => { rpcDeferreds[id] = { resolve, reject }; }); ``` If the promise property is used elsewhere (I'm not sure, but I don't think it is), you can just port the defer.js code inside the worker.js that uses it and adapt the code slightly. Hopefully that's helpful, please let me know if you've got any questions.