Closed JohnMasen closed 7 years ago
Thanks for the opening the issue @JohnMasen! The out
type is intentional as PInvoke can marshall the type. See JsHasProperty for another example.
JsCreateExternalArrayBuffer is supposed to create an external ArrayBuffer, expected to return a Javascriptvalue instead of a bool flag.
I've modified the method signature to return Javascriptvalue and now it works. please correct the wrapper to avoid confuse others.
here's the modified version
internal static extern JavaScriptErrorCode JsCreateExternalArrayBuffer(IntPtr data, uint byteLength, JavaScriptObjectFinalizeCallback finalizeCallback, IntPtr callbackState, out JavaScriptValue obj);
Oh you're absolutely right, I misread it for something else. Just sent a fix https://github.com/Microsoft/Chakra-Samples/commit/24fb1f8cc1e8968de57269f59ab11467938d022e.
Native.cs
internal static extern JavaScriptErrorCode JsCreateExternalArrayBuffer(IntPtr data, uint byteLength, JavaScriptObjectFinalizeCallback finalizeCallback, IntPtr callbackState, out bool result);
Document