(methodName unistring.String)
| 835 | } |
| 836 | |
| 837 | func (o *Object) tryPrimitive(methodName unistring.String) Value { |
| 838 | if method, ok := o.self.getStr(methodName, nil).(*Object); ok { |
| 839 | if call, ok := method.self.assertCallable(); ok { |
| 840 | v := call(FunctionCall{ |
| 841 | This: o, |
| 842 | }) |
| 843 | if _, fail := v.(*Object); !fail { |
| 844 | return v |
| 845 | } |
| 846 | } |
| 847 | } |
| 848 | return nil |
| 849 | } |
| 850 | |
| 851 | func (o *Object) ordinaryToPrimitiveNumber() Value { |
| 852 | if v := o.tryPrimitive("valueOf"); v != nil { |
no test coverage detected