Skip to content

Commit

Permalink
Fixed calling getPrototypeOf(null) (#155)
Browse files Browse the repository at this point in the history
* fixed calling getPrototypeOf(null)
  • Loading branch information
Cerberus committed Jan 18, 2022
1 parent 6c69497 commit d93200a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/runner-vm/src/instanceof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d93200a

Please sign in to comment.