diff --git a/packages/runner-vm/src/instanceof.ts b/packages/runner-vm/src/instanceof.ts index a27986087..4194ba70b 100644 --- a/packages/runner-vm/src/instanceof.ts +++ b/packages/runner-vm/src/instanceof.ts @@ -85,6 +85,7 @@ function ordinaryHasInstance(C: any, O: any): boolean { // 2. If C has a [[BoundTargetFunction]] internal slot, ... (IGNORED) // 3. If Type(O) is not Object, return false. if (typeof O !== "object" && typeof O !== "function") return false; + if (O === null) return false; // 4. Let P be ? Get(C, "prototype"). const P = C.prototype; // 5. If Type(P) is not Object, throw a TypeError exception.