| 37 | } |
| 38 | |
| 39 | func (h *nativeProxyHandler) getOwnPropertyDescriptorStr(target *Object, prop unistring.String) (Value, bool) { |
| 40 | if trap := h.handler.GetOwnPropertyDescriptorIdx; trap != nil { |
| 41 | if idx, ok := strToInt(prop); ok { |
| 42 | desc := trap(target, idx) |
| 43 | return desc.toValue(target.runtime), true |
| 44 | } |
| 45 | } |
| 46 | if trap := h.handler.GetOwnPropertyDescriptor; trap != nil { |
| 47 | desc := trap(target, prop.String()) |
| 48 | return desc.toValue(target.runtime), true |
| 49 | } |
| 50 | return nil, false |
| 51 | } |
| 52 | |
| 53 | func (h *nativeProxyHandler) getOwnPropertyDescriptorIdx(target *Object, prop valueInt) (Value, bool) { |
| 54 | if trap := h.handler.GetOwnPropertyDescriptorIdx; trap != nil { |