console.log and output formatter return promises in different orders cross-browser
Categories
(DevTools :: Console, defect, P3)
Tracking
(firefox86 fixed)
Tracking | Status | |
---|---|---|
firefox86 | --- | fixed |
People
(Reporter: kereliuk, Assigned: nchevobbe)
References
Details
Attachments
(2 files)
2.41 KB,
patch
|
Details | Diff | Splinter Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Comment 1•7 years ago
|
||
Comment 2•7 years ago
|
||
Assignee | ||
Updated•7 years ago
|
Updated•7 years ago
|
Assignee | ||
Comment 3•6 years ago
|
||
Logan, would you have an idea how this could be fixed?
Comment 4•6 years ago
|
||
The example output seems to show 2 separate issues:
- The console.log outputs show after the eval result, even though the log would have run before that
- The eval result shows the value as it was after synchronous execution but before microtask queue flush.
For the first one, I'm assuming that something causes those messages to come in in the wrong order. I'm not really looking into that since I assume you're more familiar with that.
For the second issue, I think the thing to do would be to make the evaluation run in its own task, and then process the result in a task that runs immediately after it, so that the first task will complete and fully drain the microtask queue before the evaluated result object is rendered for console display. I've attached a patch to demonstrate what I mean.
Updated•5 years ago
|
Assignee | ||
Comment 5•5 years ago
|
||
This way we ensure that any microtask created by the evaluated expression are
run, which can impact what we send to the client (e.g. Promise.resolve().then(() => 246)
will show a resolved promise instead of a pending one).
Some stubs and node tests are added to ensure this does fix the issue.
Updated•5 years ago
|
Comment 7•5 years ago
|
||
bugherder |
Description
•