Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 66e66e5

Browse filesBrowse 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 <info@bnoordhuis.nl>
1 parent a91f6b8 commit 66e66e5
Copy full SHA for 66e66e5

File tree

Expand file treeCollapse file tree

1 file changed

+4
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-7
lines changed
Open diff view settings
Collapse file

‎lib/repl.js‎

Copy file name to clipboardExpand all lines: lib/repl.js
+4-7Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.