JSReference constructor (1 of 2)
Creates a new instance of a JSReference
that holds a strong or weak reference to a JS value.
C#
public JSReference(JSValue value, bool isWeak = false)
parameter | description |
---|---|
value | The JavaScript value to reference. |
isWeak | True if the reference will be "weak", meaning the reference does not prevent the value from being released and collected by the JS garbage-collector. The default is false, meaning the value will remain available at least until the "strong" reference is disposed. |
See Also
- struct JSValue
- class JSReference
- namespace Microsoft.JavaScript.NodeApi
JSReference constructor (2 of 2)
Creates a new instance of a JSReference
that holds a strong or weak reference to a JS value.
C#
public JSReference(napi_ref handle, bool isWeak = false)
parameter | description |
---|---|
handle | The reference handle. |
isWeak | True if the handle is for a weak reference. This must match the existing state of the handle. |
See Also
- struct napi_ref
- class JSReference
- namespace Microsoft.JavaScript.NodeApi