-
- Downloads
Bug 1491354 - Extends top-level await mapping from debugger to toolbox; r=bgrins,jlast.
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. Differential Revision: https://phabricator.services.mozilla.com/D6038 --HG-- extra : moz-landing-system : lando
Showing
- devtools/client/debugger/new/dist/parser-worker.js 17 additions, 2 deletionsdevtools/client/debugger/new/dist/parser-worker.js
- devtools/client/debugger/new/src/actions/expressions.js 5 additions, 2 deletionsdevtools/client/debugger/new/src/actions/expressions.js
- devtools/client/debugger/new/src/actions/preview.js 5 additions, 1 deletiondevtools/client/debugger/new/src/actions/preview.js
- devtools/client/debugger/panel.js 1 addition, 1 deletiondevtools/client/debugger/panel.js
- devtools/client/framework/toolbox.js 20 additions, 0 deletionsdevtools/client/framework/toolbox.js
- devtools/client/webconsole/components/JSTerm.js 28 additions, 5 deletionsdevtools/client/webconsole/components/JSTerm.js
- devtools/client/webconsole/test/mochitest/browser.ini 2 additions, 0 deletionsdevtools/client/webconsole/test/mochitest/browser.ini
- devtools/client/webconsole/test/mochitest/browser_jsterm_await.js 85 additions, 0 deletions.../client/webconsole/test/mochitest/browser_jsterm_await.js
- devtools/client/webconsole/test/mochitest/browser_jsterm_await_paused.js 62 additions, 0 deletions.../webconsole/test/mochitest/browser_jsterm_await_paused.js
- devtools/client/webconsole/webconsole.js 24 additions, 5 deletionsdevtools/client/webconsole/webconsole.js
Loading
Please register or sign in to comment