There has been an effort to avoid engine specific error message sniffs.
In this case I spotted a few V8 specific sniffs in the repl.
| varmessage=e.message; |
| if(message==='Unterminated template literal'|| |
| message==='Unexpected end of input'){ |
| returntrue; |
| } |
| |
| if(message==='missing ) after argument list'){ |
| constframes=e.stack.split(/\r?\n/); |
| constpos=frames.findIndex((f)=>f.match(/^\s*\^+$/)); |
| returnpos>0&&frames[pos-1].length===frames[pos].length; |
| } |
| |
| if(message==='Invalid or unexpected token') |
| returnisCodeRecoverable(code); |
There has been an effort to avoid engine specific error message sniffs.
In this case I spotted a few V8 specific sniffs in the repl.
node/lib/repl.js
Lines 1492 to 1505 in a40e062