Closed Bug 1310608 Opened 8 years ago Closed 8 years ago

Add rep for Promises

Categories

(DevTools :: Shared Components, defect)

defect
Not set
normal

Tracking

(firefox52 fixed)

RESOLVED FIXED
Firefox 52
Tracking Status
firefox52 --- fixed

People

(Reporter: ntim, Assigned: nchevobbe)

References

Details

Attachments

(1 file)

Old console:
>> var p = new Promise((resolve) => resolve(true))
<- Promise { <state>: "fulfilled", <value>: true }

New console:
>> var p = new Promise((resolve) => resolve(true))
<- Promise { }

The new console should support the old rep of Promises.
Component: Developer Tools: Console → Developer Tools: Shared Components
Summary: New console output doesn't support representing Promises → Add rep for Promises
Assignee: nobody → chevobbe.nicolas
Comment on attachment 8803967 [details]
Bug 1310608 - Add a Rep for Promises. ;

https://reviewboard.mozilla.org/r/88150/#review88432

Nice!

R+

Just one question inline.

Honza

::: devtools/client/shared/components/reps/promise.js:47
(Diff revision 1)
> +        keys.push("value");
> +      }
> +
> +      return keys.map((key, i) => {
> +        return PropRep(Object.assign({}, this.props, {
> +          mode: "tiny",

If the promise-resoloved-value is an object we don't have it's 'grip-preview' and so, we can't display its properties, right?

(that's why 'tiny' mode is used)

Honza
Attachment #8803967 - Flags: review?(odvarko) → review+
Comment on attachment 8803967 [details]
Bug 1310608 - Add a Rep for Promises. ;

https://reviewboard.mozilla.org/r/88150/#review88432

> If the promise-resoloved-value is an object we don't have it's 'grip-preview' and so, we can't display its properties, right?
> 
> (that's why 'tiny' mode is used)
> 
> Honza

Yes, that's true.

FYI, this is how Promise are displayed in the old console : 
`Promise.resolve({a:"b"})` is logged as "Promise { <state>: "fulfilled", <value>: Object }"
Pushed by chevobbe.nicolas@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/b7e94b82004e
Add a Rep for Promises. r=Honza;
https://hg.mozilla.org/mozilla-central/rev/b7e94b82004e
Status: NEW → RESOLVED
Closed: 8 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: