We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0cb7f22 commit 96781d6Copy full SHA for 96781d6
lib/internal/repl/await.js
@@ -19,6 +19,7 @@ const {
19
20
const parser = require('internal/deps/acorn/acorn/dist/acorn').Parser;
21
const walk = require('internal/deps/acorn/acorn-walk/dist/walk');
22
+const { Recoverable } = require('internal/repl');
23
24
const noop = FunctionPrototype;
25
const visitorsWithoutAncestors = {
@@ -94,6 +95,8 @@ function processTopLevelAwait(src) {
94
95
try {
96
root = parser.parse(wrapped, { ecmaVersion: 'latest' });
97
} catch (e) {
98
+ if (e.message.startsWith('Unterminated '))
99
+ throw new Recoverable(e);
100
// If the parse error is before the first "await", then use the execution
101
// error. Otherwise we must emit this parse error, making it look like a
102
// proper syntax error.
0 commit comments