Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit d93200a

Browse files
authored
Fixed calling getPrototypeOf(null) (#155)
* fixed calling getPrototypeOf(null)
1 parent 6c69497 commit d93200a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/runner-vm/src/instanceof.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ function ordinaryHasInstance(C: any, O: any): boolean {
8585
// 2. If C has a [[BoundTargetFunction]] internal slot, ... (IGNORED)
8686
// 3. If Type(O) is not Object, return false.
8787
if (typeof O !== "object" && typeof O !== "function") return false;
88+
if (O === null) return false;
8889
// 4. Let P be ? Get(C, "prototype").
8990
const P = C.prototype;
9091
// 5. If Type(P) is not Object, throw a TypeError exception.

0 commit comments

Comments
 (0)