[DevTools] support top-level await in console

Desktop / Chromium - Alexey Kozyatinskiy [chromium.org] - 10 August 2017 20:28 EDT

If expression could be successfully compiled without preprocessing -we do nothing. Otherwise if function contains await expression:- if variable is var or variable is top-level we remove variable kind to make it available in global scope.- function definitions: function foo() {} -> foo = function foo() {}- top-level class definitions: class Foo {} -> Foo = class Foo {}

R=lushnikov@chromium.org,loue@chromium.org

Bug: chromium:658558 Change-Id: I8e9d26b93c3e53a966e43ec9c72b931a45c1a294 Reviewed-on: https://chromium-review.googlesource.com/601509 Commit-Queue: Aleksey Kozyatinskiy

e8111c3 [DevTools] support top-level await in console
.../console/console-top-level-await-expected.txt | 85 +++++++++++++++++++++
.../devtools/console/console-top-level-await.js | 65 ++++++++++++++++
.../preprocess-top-level-awaits-expected.txt | 82 ++++++++++++++++++++
.../inspector-unit/preprocess-top-level-awaits.js | 40 ++++++++++
.../debugger-ui/show-function-definition.html | 3 +-
.../devtools/front_end/console/ConsolePrompt.js | 16 +++-
.../Source/devtools/front_end/console/module.json | 3 +-
.../front_end/console_model/ConsoleModel.js | 32 +++++---
.../front_end/formatter/FormatterWorkerPool.js | 8 ++
.../front_end/formatter_worker/FormatterWorker.js | 88 ++++++++++++++++++++++
.../Source/devtools/front_end/sdk/RuntimeModel.js | 5 +-
.../devtools/front_end/sources/SourcesPanel.js | 17 +++--
.../devtools/front_end/unit_test_runner.json | 3 +-
13 files changed, 423 insertions(+), 24 deletions(-)

Upstream: git.chromium.org


  • Share