From c158591b35653e96eaea54ea7c7438a0256e8948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Tue, 21 Jun 2022 22:32:03 +0200 Subject: [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 --- src/mono/wasm/runtime/js-to-cs.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/mono/wasm/runtime') 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, 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(result_address); + const resultRoot = mono_wasm_new_external_root(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 { -- cgit v1.2.3