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

Method Free

value.go:109–120  ·  view source on GitHub ↗

Free the value.

()

Source from the content-addressed store, hash-verified

107
108// Free the value.
109func (v *Value) Free() {
110 if !v.hasValidContext() || bool(C.JS_IsUndefined(v.ref)) {
111 return // No context or undefined value, nothing to free
112 }
113 if v.borrowed {
114 v.ref = C.JS_NewUndefined()
115 v.borrowed = false
116 return
117 }
118 C.JS_FreeValue(v.ctx.ref, v.ref)
119 v.ref = C.JS_NewUndefined()
120}
121
122// Context returns the context of the value.
123func (v *Value) Context() *Context {

Callers 15

wrapPromiseCallbackMethod · 0.95
exceptionErrorMethod · 0.95
AwaitMethod · 0.95
LenMethod · 0.45
ByteLenMethod · 0.45
ToErrorMethod · 0.45
propertyEnumMethod · 0.45
HasIdxMethod · 0.45
GlobalInstanceofMethod · 0.45
ToInt8ArrayMethod · 0.45
ToInt16ArrayMethod · 0.45

Calls 1

hasValidContextMethod · 0.95

Tested by 1