Closed Bug 1491354 Opened Last year Closed Last year
Extends top-level await mapping from debugger to toolbox
No description provided.
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.
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.
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/3eff766fa7c2 Extends top-level await mapping from debugger to toolbox; r=bgrins,jlast.
You need to log in before you can comment on or make changes to this bug.