| 19 | } |
| 20 | |
| 21 | func resolveClassObjectFromOpaque(ctx *Context, opaque unsafe.Pointer) (*Context, int32, bool) { |
| 22 | if ctx == nil || ctx.runtime == nil || opaque == nil { |
| 23 | return nil, 0, false |
| 24 | } |
| 25 | |
| 26 | objectID := int32(C.OpaqueToInt(opaque)) |
| 27 | if objectID < 0 { |
| 28 | identity, ok := ctx.runtime.getClassObjectIdentity(objectID) |
| 29 | if ok { |
| 30 | ownerCtx := ctx.runtime.getOwnedContextByID(identity.contextID) |
| 31 | if ownerCtx == nil || ownerCtx.handleStore == nil { |
| 32 | return nil, 0, false |
| 33 | } |
| 34 | return ownerCtx, identity.handleID, true |
| 35 | } |
| 36 | } |
| 37 | return nil, 0, false |
| 38 | } |
| 39 | |
| 40 | //export goClassConstructorProxy |
| 41 | func goClassConstructorProxy(ctx *C.JSContext, newTarget C.JSValueConst, |