repl: fix error message printing · nodejs/node@70e094a · GitHub
Skip to content

Commit 70e094a

Browse files
addaleaxrichardlau
authored andcommitted
repl: fix error message printing
The REPL implementation would strip away the first and last character of a formatted error message if it ended with `]` (but with the obviously missing check for a starting `]`), leading to things like `Uncaught rror: foo[a` being printed for input like `Error: foo[a]`. Refs: #22436 PR-URL: #38209 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent f0be077 commit 70e094a

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

lib/repl.js

Lines changed: 1 addition & 1 deletion
Lines changed: 23 additions & 0 deletions

0 commit comments

Comments
 (0)