fix: custom instOfHandler result should be cast to boolean (#10197)
This commit is contained in:
committed by
Nicolò Ribaudo
parent
4eab157502
commit
e88a569e83
@@ -4,6 +4,11 @@ foo[Symbol.hasInstance]= function () { return true; };
|
||||
var bar = {};
|
||||
|
||||
expect(bar instanceof foo).toBe(true);
|
||||
|
||||
var qux = {};
|
||||
qux[Symbol.hasInstance]= function () { return NaN };
|
||||
expect(bar instanceof qux).toBe(false);
|
||||
|
||||
expect(new String).toBeInstanceOf(String);
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user