Skip to content

Commit

Permalink
repl: fix repl after V8 upgrade
Browse files Browse the repository at this point in the history
V8 improved the error message for illegal token in
v8/v8@879b617b. This breaks the recoverable
error handling in repl.

Ref: nodejs#6482

PR-URL: nodejs#7016
Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]>
  • Loading branch information
ofrobots authored and targos committed Jun 29, 2016
1 parent 6dfa533 commit a33909e
Showing 1 changed file with 4 additions and 7 deletions.
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);
}
return false;
}
Expand Down

0 comments on commit a33909e

Please sign in to comment.