export goClassGetterProxy
(ctx *C.JSContext, thisVal C.JSValueConst, magic C.int)
| 96 | |
| 97 | //export goClassGetterProxy |
| 98 | func goClassGetterProxy(ctx *C.JSContext, thisVal C.JSValueConst, magic C.int) C.JSValue { |
| 99 | goCtx, fn, err := getContextAndObject(ctx, magic, errGetterNotFound) |
| 100 | if err != nil { |
| 101 | return throwProxyError(ctx, *err) |
| 102 | } |
| 103 | |
| 104 | getter, ok := fn.(ClassGetterFunc) |
| 105 | if !ok { |
| 106 | return throwProxyError(ctx, errInvalidGetterType) |
| 107 | } |
| 108 | |
| 109 | thisValue := &Value{ctx: goCtx, ref: C.JSValue(thisVal)} |
| 110 | result := getter(goCtx, thisValue) |
| 111 | if result == nil { |
| 112 | return C.JS_NewUndefined() |
| 113 | } |
| 114 | return result.ref |
| 115 | } |
| 116 | |
| 117 | //export goClassSetterProxy |
| 118 | func goClassSetterProxy(ctx *C.JSContext, thisVal C.JSValueConst, |
no test coverage detected