Skip to content
Prev Previous commit
Next Next commit
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.

PR-URL: #6482
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
ofrobots authored and targos committed Jun 29, 2016
commit 78e6691a8971ee9f0d03faf210b0c40e9fe60e08
11 changes: 4 additions & 7 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1224,15 +1224,12 @@ function isRecoverableError(e, self) {
}

if (message.startsWith('Unexpected end of input') ||
message.startsWith('missing ) after argument list'))
message.startsWith('missing ) after argument list') ||
message.startsWith('Unexpected token'))
return true;

if (message.startsWith('Unexpected token')) {
if (message.includes('ILLEGAL') && bailOnIllegalToken(self.lineParser))
return false;
else
return true;
}
if (message === 'Invalid or unexpected token')
return !bailOnIllegalToken(self.lineParser);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to change this commit after #7104

}
return false;
}
Expand Down