fix: custom instOfHandler result should be cast to boolean (#10197)

This commit is contained in:
Huáng Jùnliàng
2019-07-10 17:38:46 -04:00
committed by Nicolò Ribaudo
parent 4eab157502
commit e88a569e83
2 changed files with 6 additions and 1 deletions

View File

@@ -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);
//