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

Method ordinaryToPrimitiveString

object.go:863–873  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

861}
862
863func (o *Object) ordinaryToPrimitiveString() Value {
864 if v := o.tryPrimitive("toString"); v != nil {
865 return v
866 }
867
868 if v := o.tryPrimitive("valueOf"); v != nil {
869 return v
870 }
871
872 panic(o.runtime.NewTypeError("Could not convert %v (%T) to primitive", o.self, o.self))
873}
874
875func (o *Object) tryExoticToPrimitive(hint Value) Value {
876 exoticToPrimitive := toMethod(o.self.getSym(SymToPrimitive, nil))

Callers 3

toPrimitiveStringMethod · 0.95
dateproto_toPrimitiveMethod · 0.80
strMethod · 0.80

Calls 2

tryPrimitiveMethod · 0.95
NewTypeErrorMethod · 0.80

Tested by

no test coverage detected