diff options
author | Marek FiĊĦera <mara@neptuo.com> | 2022-06-21 23:32:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-21 23:32:03 +0300 |
commit | c158591b35653e96eaea54ea7c7438a0256e8948 (patch) | |
tree | 74a0265b526878fa571d114e66526ff3388141ea /src/mono/wasm/runtime | |
parent | 8fb75deb4697d83769dee46248f57ac5173995d8 (diff) |
[wasm] Migrate to ref/out param while reading data from typed array (#70823)
Use js_typed_array_to_array_root in mono_wasm_typed_array_to_array_ref
Diffstat (limited to 'src/mono/wasm/runtime')
-rw-r--r-- | src/mono/wasm/runtime/js-to-cs.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mono/wasm/runtime/js-to-cs.ts b/src/mono/wasm/runtime/js-to-cs.ts index c3179b13b0d..3959c3d8ce6 100644 --- a/src/mono/wasm/runtime/js-to-cs.ts +++ b/src/mono/wasm/runtime/js-to-cs.ts @@ -278,7 +278,7 @@ export function _wrap_js_thenable_as_task_root(thenable: Promise<any>, resultRoo } export function mono_wasm_typed_array_to_array_ref(js_handle: JSHandle, is_exception: Int32Ptr, result_address: MonoObjectRef): void { - const resultRoot = mono_wasm_new_external_root<MonoObject>(result_address); + const resultRoot = mono_wasm_new_external_root<MonoArray>(result_address); try { const js_obj = mono_wasm_get_jsobj_from_js_handle(js_handle); if (is_nullish(js_obj)) { @@ -287,8 +287,7 @@ export function mono_wasm_typed_array_to_array_ref(js_handle: JSHandle, is_excep } // returns pointer to C# array - // FIXME: ref - resultRoot.value = js_typed_array_to_array(js_obj); + js_typed_array_to_array_root(js_obj, resultRoot); } catch (exc) { wrap_error_root(is_exception, String(exc), resultRoot); } finally { |