Fix isBigNumber

This commit is contained in:
Guillaume Ballet 2019-12-11 16:41:04 +01:00
parent fe2b2e0033
commit 6e84c7b5e9

View file

@ -263,11 +263,11 @@ func (ctx ppctx) isBigNumber(v *goja.Object) bool {
return false
}
prototype := BigNumber.Get("prototype").ToObject(ctx.vm)
isPrototypeOf, exists := goja.AssertFunction(prototype.Get("isPrototypeOf"))
if !exists {
isPrototypeOf, callable := goja.AssertFunction(prototype.Get("isPrototypeOf"))
if !callable {
return false
}
bv, _ := isPrototypeOf(v)
bv, _ := isPrototypeOf(prototype, v)
return bv.ToBoolean()
}