Closed
Bug 1380711
Opened 8 years ago
Closed 9 months ago
Investigate in showing Promise update in the Object inspector
Categories
(DevTools :: Object Inspector, enhancement, P3)
DevTools
Object Inspector
Tracking
(firefox57 fix-optional)
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox57 | --- | fix-optional |
People
(Reporter: Oriol, Unassigned)
References
Details
1. Open the new console frontend
2. Enter new Promise(f => setTimeout(f, 0))
3. The preview shows Promise { <state>: "pending" } because the promise didn't resolve immediately
4. Expand the promise
Result: it still says <state> : "pending", but now the promise has been resolved.
This didn't happen with variablesview, e.g.
> var p = new Promise(f => setTimeout(f, 0)); p;
Promise { <state>: "pending" }
> inspect(p);
Updated•8 years ago
|
Whiteboard: [console-html] [triage]
Updated•8 years ago
|
Flags: qe-verify?
Priority: -- → P3
Whiteboard: [console-html] [triage] → [reserve-console-html]
Comment 1•8 years ago
|
||
I am not sure if this should be considered as a bug here.
If we wanted to be more fair, we should compare
```new Promise(f => setTimeout(f, 0))```
with
```inspect(new Promise(f => setTimeout(f, 0)))```
or
```
> p = new Promise(f => setTimeout(f, 0));
> p;
```
with
```
> p = new Promise(f => setTimeout(f, 0));
> inspect(p);
```
Because in the latter case, you give time to the Promise to be resolved.
If we compare apples to apples, the Object Inspector and the VariableView behaves the same way.
Which I think is the correct way since logging show you the value of an object at the specific time you logged it.
What we could think about though, is having a way to tell the user that an object was updated and add a reload/refresh button on it so the user can see the new value.
I am not sure if this is useful for all objects, but promise might be a good candidate for this.
I am a bit concerned too of the performance cost that this would introduce if we start watching for every update on every logged object.
Summary: Object inspector does not retrieve new Promise state → Investigate in showing Promise update in the Object inspector
Updated•8 years ago
|
Flags: qe-verify?
Priority: P3 → --
Whiteboard: [reserve-console-html]
Updated•7 years ago
|
status-firefox57:
--- → fix-optional
Priority: -- → P3
Updated•7 years ago
|
Severity: normal → enhancement
Updated•7 years ago
|
Product: Firefox → DevTools
Comment 2•5 years ago
|
||
Moving to the DOM panel as it's VariableView related and only the DOM panel uses the VariableView now
Component: Object Inspector → DOM
Comment 3•5 years ago
|
||
erratum: this should have been moved to the storage inspector, which is the last consumer of the variable view
Component: DOM → Storage Inspector
Updated•2 years ago
|
Severity: normal → S3
Comment 4•9 months ago
|
||
since it's only used in Storage, the VariableView doesn't ever display Promises
Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → WONTFIX
Reporter | ||
Comment 5•9 months ago
|
||
This is unrelated to storage. The problem was that, when expanding a resolved promise which was still pending when creating its preview, it would still be shown as pending.
This was inconsistent with what happens when expanding the result of
var o = {};
setTimeout(() => {o.a = 1}, 100);
o;
I fixed the problem as a side effect of bug 1552648.
You need to log in
before you can comment on or make changes to this bug.
Description
•