Skip to content

JSMarshaller.BuildFromJSConstructorExpression method

Builds a lambda expression for a JS callback adapter that constructs an instance of a .NET class or struct. When invoked, the expression will marshal the constructor arguments from JS, invoke the constructor, then return the new instance either as a wrapped .NET class or a JS object marshalled from the struct.

C#
public Expression<JSCallback> BuildFromJSConstructorExpression(ConstructorInfo constructor)

Remarks

The returned expression takes a JSCallbackArgs parameter and returns a JS value for the constructed instance. The lambda expression may be converted to a delegate with Compile, and used as the constructor callback parameter for a JSClassBuilder.

See Also

Released under the MIT license