{"version":"2.1.271","anchor":"errorhasinstance-cross-realm-polyfill-made-more-precise","canonical_anchor":"errorhasinstance-cross-realm-polyfill-made-more-precise","heading":"Error.hasInstance cross-realm polyfill made more precise","tier":"internal","area":"Elsewhere","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.271\/e\/errorhasinstance-cross-realm-polyfill-made-more-precise","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.271","markdown":"### Error.hasInstance cross-realm polyfill made more precise\n\nA Node VM sandbox polyfill for Error instance checks now only overrides behavior for the base Error class\n\n**What**\n\nClaude Code runs some code inside a Node VM context (an isolated JavaScript sandbox), which needs a workaround so `instanceof Error` checks work correctly across that boundary. That workaround now only kicks in when the check is against `Error` itself; checks against subclasses of `Error` fall back to JavaScript's normal built-in behavior instead of being overridden.\n\n**Why**\n\nThe previous version overrode the check unconditionally, which could give wrong answers for custom error subclasses. Narrowing it to just `Error` makes instance checks behave correctly in more cases.\n\n- Area: Elsewhere\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 1\/5"}