MCPcopy Create free account
hub / github.com/dop251/goja / ordinaryToPrimitiveNumber

Method ordinaryToPrimitiveNumber

object.go:851–861  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

849}
850
851func (o *Object) ordinaryToPrimitiveNumber() Value {
852 if v := o.tryPrimitive("valueOf"); v != nil {
853 return v
854 }
855
856 if v := o.tryPrimitive("toString"); v != nil {
857 return v
858 }
859
860 panic(o.runtime.NewTypeError("Could not convert %v to primitive", o.self))
861}
862
863func (o *Object) ordinaryToPrimitiveString() Value {
864 if v := o.tryPrimitive("toString"); v != nil {

Callers 4

toPrimitiveNumberMethod · 0.95
toPrimitiveMethod · 0.95
dateproto_toPrimitiveMethod · 0.80
strMethod · 0.80

Calls 2

tryPrimitiveMethod · 0.95
NewTypeErrorMethod · 0.80

Tested by

no test coverage detected