Run JavaScript: Detect await at the beginning of a line

This commit is contained in:
Dan Stillman 2020-12-24 02:46:55 -05:00
parent 018f04f369
commit 1040ba0b5e

View file

@ -44,7 +44,7 @@ function handleInput() { // eslint-disable-line no-unused-vars
}
var code = codeEditor.getSession().getValue();
// If `await` is used, switch to async mode
if (/[^=([]\s*await\s/m.test(code)) {
if (/(^|[^=([]\s*)await\s/m.test(code)) {
checkbox.checked = true;
update();
}