A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Microsoft/TypeScript/issues/13965 below:

instanceof is broken when class extends Error type · Issue #13965 · microsoft/TypeScript · GitHub

TypeScript Version: 2.1.1

class BaseError extends Error {}
class Error1 extends BaseError {}

let error = new Error1();
console.log(error instanceof Error1);

Expected behavior:
prints true.

Actual behavior:
prints false.

Note:
This happens only when a type extends Error.
After removing extends Error from BaseError everything works as expected.

Links
Test case

zry656565, kostrse, lifenautjoe, ProofOfKeags, tahkojuusto and 15 more


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4