()
| 849 | } |
| 850 | |
| 851 | func (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 | |
| 863 | func (o *Object) ordinaryToPrimitiveString() Value { |
| 864 | if v := o.tryPrimitive("toString"); v != nil { |
no test coverage detected