From 1040ba0b5ea6d6a87074826463ee1c17f4cb22b6 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 24 Dec 2020 02:46:55 -0500 Subject: [PATCH] Run JavaScript: Detect `await` at the beginning of a line --- chrome/content/zotero/runJS.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chrome/content/zotero/runJS.js b/chrome/content/zotero/runJS.js index a5e666adb5..037c37b147 100644 --- a/chrome/content/zotero/runJS.js +++ b/chrome/content/zotero/runJS.js @@ -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(); }