export goClassSetterProxy
(ctx *C.JSContext, thisVal C.JSValueConst, val C.JSValueConst, magic C.int)
| 116 | |
| 117 | //export goClassSetterProxy |
| 118 | func goClassSetterProxy(ctx *C.JSContext, thisVal C.JSValueConst, |
| 119 | val C.JSValueConst, magic C.int) C.JSValue { |
| 120 | |
| 121 | goCtx, fn, err := getContextAndObject(ctx, magic, errSetterNotFound) |
| 122 | if err != nil { |
| 123 | return throwProxyError(ctx, *err) |
| 124 | } |
| 125 | |
| 126 | setter, ok := fn.(ClassSetterFunc) |
| 127 | if !ok { |
| 128 | return throwProxyError(ctx, errInvalidSetterType) |
| 129 | } |
| 130 | |
| 131 | thisValue := &Value{ctx: goCtx, ref: C.JSValue(thisVal)} |
| 132 | setValue := &Value{ctx: goCtx, ref: C.JSValue(val)} |
| 133 | result := setter(goCtx, thisValue, setValue) |
| 134 | if result == nil { |
| 135 | return C.JS_NewUndefined() |
| 136 | } |
| 137 | return result.ref |
| 138 | } |
no test coverage detected