Closed Bug 1491354 Opened Last year Closed Last year

Extends top-level await mapping from debugger to toolbox

Categories

(DevTools :: Console, enhancement, P1)

enhancement

Tracking

(firefox64 fixed)

RESOLVED FIXED
Firefox 64
Tracking Status
firefox64 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

Details

(Whiteboard: [boogaloo-mvp])

Attachments

(1 file)

No description provided.
Whiteboard: [boogaloo-mvp]
This patch makes the parser-worker available at the toolbox level.
This way, the console does not have to rely on the debugger being
open to map top-level await expression.
In order to make the worker works in the toolbox, some changes
are required (passing a window object, checking inToolbox differently).

We take this as an opportunity to *not* display the async iife result,
a promise, in the console. This is made by checking if the input was
mapped, and if so, ignoring the result we get from the server.

A couple tests are added to ensure the basic usage works as expected.

This patch should be considered as a v0 for top-level await evaluation
as there are things that are not perfect here. Since we rely on console.log
the result are treated differently from other evaluation results:
- the style is different
- the result gets added to the log cache (when restarting the console,
the results will still be displayed, but not the commands).
- the results can be filtered, although evaluation results should not
- `$_` after a top-level await evaluation returns the Promise created
by the async iife, not the result that was displayed in the console.

All those should be addressed in Bug 1410820.
Comment on attachment 9009616 [details]
Bug 1491354 - Extends top-level await mapping from debugger to toolbox; r=jlast,bgrins.

Jason Laster [:jlast] has approved the revision.
Attachment #9009616 - Flags: review+
Comment on attachment 9009616 [details]
Bug 1491354 - Extends top-level await mapping from debugger to toolbox; r=jlast,bgrins.

Brian Grinstead [:bgrins] has approved the revision.
Attachment #9009616 - Flags: review+
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3eff766fa7c2
Extends top-level await mapping from debugger to toolbox; r=bgrins,jlast.
https://hg.mozilla.org/mozilla-central/rev/3eff766fa7c2
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → Firefox 64
Blocks: 1494318
You need to log in before you can comment on or make changes to this bug.