webcontainer-core icon indicating copy to clipboard operation
webcontainer-core copied to clipboard

Classes that extend Promise break instanceof

Open smikhalevski opened this issue 5 months ago • 0 comments

Describe the bug

Promise instances are treated as instances of any class that extends Promise.

Link to the blitz that caused the error

https://stackblitz.com/edit/stackblitz-starters-q5rlbxff?file=index.js

Steps to reproduce

class Xxx extends Promise {}

Promise.resolve() instanceof Xxx // true (but must be false)
Image

Expected behavior

A fresh install of Node.js v20.19.1 produces this result:

Image

Parity with Local

Screenshots

No response

Platform

Browser name  = Chrome
Full version  = 137.0.0.0
Major version = 137
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
performance.memory = {
  "totalJSHeapSize": 65797982,
  "usedJSHeapSize": 63431078,
  "jsHeapSizeLimit": 4294705152
}
Hash = 96435430

Additional context

No response

smikhalevski avatar Jul 06 '25 13:07 smikhalevski