JSValueProtect top-level property
Protects a JavaScript value from garbage collection.
ctx
The execution context to use.
value
The JSValue to protect.
@discussion
Use this method when you want to store a JSValue in a global or on the heap, where the garbage collector will not be able to discover your reference to it.
A value may be protected multiple times and must be unprotected an equal number of times before becoming eligible for garbage collection.
Implementation
final void Function(JSContextRef ctx, JSValueRef value) JSValueProtect = jscLib.lookup<NativeFunction<Void Function(JSContextRef ctx, JSValueRef value)>>('JSValueProtect').asFunction();