From 072a6a811891286d6a7eba8cc35b5a814701afe0 Mon Sep 17 00:00:00 2001 From: dp-mason Date: Fri, 27 Dec 2024 18:58:25 -0600 Subject: [PATCH] save user function output to the host output bytes. Does not use dataview, because I assume that wasm platforms will be little endian --- template/src/index.ts.ejs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/template/src/index.ts.ejs b/template/src/index.ts.ejs index 06b7160..30ae2ab 100644 --- a/template/src/index.ts.ejs +++ b/template/src/index.ts.ejs @@ -50,6 +50,8 @@ export function <%- ex.name %>(): number { <% } -%> <% } else if (ex.output.type === 'string') { -%> Host.outputString(output) + <% } else if (ex.output.type === 'number') { -%> + Host.outputBytes(Float32Array.of(output).buffer) <% } else { -%> Host.outputBytes(output) <% } -%> @@ -59,4 +61,3 @@ export function <%- ex.name %>(): number { } <% }) %> -