Open Bug 1494728 Opened 6 years ago Updated 2 years ago

Debugger.isCompilableUnit doesn't seem to work well with top-level await expressions

Categories

(DevTools :: Console, defect, P2)

defect

Tracking

(Not tracked)

People

(Reporter: nchevobbe, Unassigned)

References

(Blocks 2 open bugs)

Details

**Steps to reproduce** 1. Open the console 2. Type `await Promise(` 3. Hit Enter **Expected results** The JsTerm detect that the input is malformed and add a new line (like when typing `Promise(`) **Actual results** The input gets evaluated (and throws) --- In the JsTerm, the Enter key handler should detect input that shouldn't be executed using Debugger.isCompilableUnit [1], but my guess is that it does not work at all, since top-level await are not valid (yet). https://searchfox.org/mozilla-central/rev/ce57be88b8aa2ad03ace1b9684cd6c361be5109f/devtools/client/webconsole/components/JSTerm.js#208-210
It would be nice if we could fix that before shipping top level await support in the jsterm.
Priority: -- → P2
Severity: normal → S3
Blocks: 1839588
Blocks: 1603116
You need to log in before you can comment on or make changes to this bug.