export goClassMethodProxy
(ctx *C.JSContext, thisVal C.JSValueConst, argc C.int, argv *C.JSValueConst, magic C.int)
| 73 | |
| 74 | //export goClassMethodProxy |
| 75 | func goClassMethodProxy(ctx *C.JSContext, thisVal C.JSValueConst, |
| 76 | argc C.int, argv *C.JSValueConst, magic C.int) C.JSValue { |
| 77 | |
| 78 | goCtx, fn, err := getContextAndObject(ctx, magic, errMethodNotFound) |
| 79 | if err != nil { |
| 80 | return throwProxyError(ctx, *err) |
| 81 | } |
| 82 | |
| 83 | method, ok := fn.(ClassMethodFunc) |
| 84 | if !ok { |
| 85 | return throwProxyError(ctx, errInvalidMethodType) |
| 86 | } |
| 87 | |
| 88 | thisValue := &Value{ctx: goCtx, ref: C.JSValue(thisVal)} |
| 89 | args := convertCArgsToGoValues(argc, argv, goCtx) |
| 90 | result := method(goCtx, thisValue, args) |
| 91 | if result == nil { |
| 92 | return C.JS_NewUndefined() |
| 93 | } |
| 94 | return result.ref |
| 95 | } |
| 96 | |
| 97 | //export goClassGetterProxy |
| 98 | func goClassGetterProxy(ctx *C.JSContext, thisVal C.JSValueConst, magic C.int) C.JSValue { |
no test coverage detected