MCPcopy Create free account
hub / github.com/buke/quickjs-go / getClassObjectIdentity

Method getClassObjectIdentity

runtime.go:1307–1325  ·  view source on GitHub ↗
(objectID int32)

Source from the content-addressed store, hash-verified

1305}
1306
1307func (r *Runtime) getClassObjectIdentity(objectID int32) (classObjectIdentity, bool) {
1308 if r == nil || objectID == 0 {
1309 return classObjectIdentity{}, false
1310 }
1311 v, ok := r.classObjectRegistry.Load(objectID)
1312 if !ok {
1313 return classObjectIdentity{}, false
1314 }
1315 identity, ok := v.(classObjectIdentity)
1316 if !ok {
1317 r.classObjectRegistry.Delete(objectID)
1318 return classObjectIdentity{}, false
1319 }
1320 if identity.contextID == 0 || identity.handleID <= 0 {
1321 r.classObjectRegistry.Delete(objectID)
1322 return classObjectIdentity{}, false
1323 }
1324 return identity, true
1325}
1326
1327func (r *Runtime) takeClassObjectIdentity(objectID int32) (classObjectIdentity, bool) {
1328 if r == nil || objectID == 0 {

Calls 2

LoadMethod · 0.80
DeleteMethod · 0.45