Closed Bug 885318 Opened 7 years ago Closed 7 years ago

Name collision with Promise


(DevTools :: General, defect)

Not set


(Not tracked)

Firefox 25


(Reporter: baku, Assigned: past)


(Blocks 1 open bug)



(1 file)

devtools use a lot of Promise objects implemented in JS.
But bug 884279 renames Future to Promise and this makes a name collision.

Talking on IRC on #devtools, we found 2 possible solutions:

a) Rename Promise to JSPromise (or to something else)
b) do some destructuring assignment on import, like: let {resolve, reject, etc. } = Cu.import("promise.js");
Blocks: 884279
Blocks: 885333
Component: General → Developer Tools
Product: Toolkit → Firefox
Duplicate of this bug: 885334
In a separate thread we'd decided that we should be doing s/Promise/promise/g. Would this solve the problem?
Yes, It does.
I'll work on this.
Assignee: nobody → past
This turned out to be a lerger patch than I expected, due to us using lowercase promise as a local variable identifier. Maybe destructuring on import would have resulted in a shorter patch, but I don't know for sure or care. All tests pass locally.
Attachment #773344 - Flags: review?(jwalker)
Comment on attachment 773344 [details] [diff] [review]
Rename Promise to promise to avoid collisions with the forthcoming DOM Promise implementation

Review of attachment 773344 [details] [diff] [review]:

It's kind of annoying that we can't call 'promise' 'promise' any more. Ho Hum.
Attachment #773344 - Flags: review?(jwalker) → review+
How about migrating to DOM Promise?
(In reply to Masatoshi Kimura [:emk] from comment #8)
> How about migrating to DOM Promise?

This bug is a prerequisite for DOM Future to be renamed to Promise. We will likely migrate to that once its ready and has all the API methods we need.
Closed: 7 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 25
Blocks: 875289
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.