xCallWrapped

abstract fun xCallWrapped(functionName: JsString, resultType: JsString, argsTypes: ReadonlyArray<JsString>, vararg args: JsAny): JsAny(source)
abstract fun xCallWrapped(functionName: JsString, resultType: JsString, argsTypes: JsArray<JsString>, args: ReadonlyArray<JsAny>): JsAny(source)

Functions like xCall() but performs argument and result type conversions as for xWrap().

The first argument is the name of the exported function to call. The 2nd its the name of its result type, as documented for xWrap(). The 3rd is an array of argument type names, as documented for xWrap(). The 4th+ arguments are arguments for the call, with the special case that if the 4th argument is an array, it is used as the arguments for the call.

Returns the converted result of the call.

This is just a thin wrapper around xWrap(). If the given function is to be called more than once, it's more efficient to use xWrap() to create a wrapper, then to call that wrapper as many times as needed. For one-shot calls, however, this variant is arguably more efficient because it will hypothetically free the wrapper function quickly.