Skip to content

Commit 66e66e5

Browse files
committed
repl: fix repl after V8 upgrade
V8 improved the error message for illegal token in v8/v8@879b617b. This breaks the recoverable error handling in repl. Ref: #6482 PR-URL: #7016 Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]>
1 parent a91f6b8 commit 66e66e5

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lib/repl.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,15 +1361,12 @@ function isRecoverableError(e, self) {
13611361
}
13621362

13631363
if (message.startsWith('Unexpected end of input') ||
1364-
message.startsWith('missing ) after argument list'))
1364+
message.startsWith('missing ) after argument list') ||
1365+
message.startsWith('Unexpected token'))
13651366
return true;
13661367

1367-
if (message.startsWith('Unexpected token')) {
1368-
if (message.includes('ILLEGAL') && bailOnIllegalToken(self.lineParser))
1369-
return false;
1370-
else
1371-
return true;
1372-
}
1368+
if (message === 'Invalid or unexpected token')
1369+
return !bailOnIllegalToken(self.lineParser);
13731370
}
13741371
return false;
13751372
}

0 commit comments

Comments
 (0)