JSReference.TryCreateReference method
Creates a reference to a JS value, if the value is an object, function, or symbol.
C#
public static bool TryCreateReference(JSValue value, bool isWeak, out JSReference? result)
parameter | description |
---|---|
value | The JS value to reference. |
isWeak | True to create a weak reference, false to create a strong reference. |
result | Returns the created reference, or default(JSValue) , equivalent to undefined , if the value is not a referencable type. |
Return Value
True if the reference was created, false if the reference could not be created because the value is not a supported type for references.
See Also
- struct JSValue
- class JSReference
- namespace Microsoft.JavaScript.NodeApi