Skip to content

Commit 98c2b1e

Browse files
author
Guy Bedford
authored
gen-host-js: fix ts compilation bug in newer ts versions (#460)
* gen-host-js: fix ts compilation bug in newer ts versions * avoid use of npx * cargo fmt * use buffer import * fixup buffer import * ok * Revert "avoid use of npx" This reverts commit e696ea0.
1 parent f02508e commit 98c2b1e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

crates/gen-host-js/tests/helpers.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import { readFile } from 'node:fs/promises';
33
// @ts-ignore
44
import { argv, stdout, stderr } from 'node:process';
5+
// @ts-ignore
6+
import { Buffer } from 'node:buffer';
57

68
// This is a helper function used from `host.ts` test in the `tests/runtime/*`
79
// directory to pass as the `instantiateCore` argument to the `instantiate`
@@ -17,8 +19,8 @@ export async function loadWasm(path: string) {
1719

1820
// Export a WASI interface directly for instance imports
1921
export function log (bytes: Uint8Array | ArrayBuffer) {
20-
stdout.write(bytes);
22+
stdout.write(Buffer.from(bytes));
2123
}
2224
export function logErr (bytes: Uint8Array | ArrayBuffer) {
23-
stderr.write(bytes);
25+
stderr.write(Buffer.from(bytes));
2426
}

0 commit comments

Comments
 (0)