Using instanceof SyntaxError
does not work with TypeScript
#216
Labels
blocks-release
Blocks an imminent release. High Priorty.
The following code produces an error in TypeScript:
(https://codesandbox.io/s/xenodochial-liskov-kmcyk?file=/src/index.ts)
The code reaches the
console.log
statement, i.e. the JS runs correctly. However, Typescript complains that I cannot usemyParser.SyntaxError
on the right hand side of theinstanceof
check. I tried to investigate this, but couldn't figure out why it happens. Something must be wrong with the type definitions (tested on TypeScript4.4.4
).The text was updated successfully, but these errors were encountered: