Skip to content

Commit

Permalink
Use stderr for console.{warn,error}()
Browse files Browse the repository at this point in the history
Node.js has the same behavior (and it makes sense). Now, all functions
use the correct stream.

Fixes AssemblyScript/assemblyscript#2585.
  • Loading branch information
CountBleck committed May 21, 2023
1 parent 4bf1fc1 commit 4472e6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assembly/wasi_console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ export namespace wasi_console {
}

export function warn(message: string = ""): void {
let stdout = wasi_process.stdout;
let stdout = wasi_process.stderr;
stdout.write("Warning: ");
stdout.write(message);
stdout.write("\n");
}

export function error(message: string = ""): void {
let stdout = wasi_process.stdout;
let stdout = wasi_process.stderr;
stdout.write("Error: ");
stdout.write(message);
stdout.write("\n");
Expand Down

0 comments on commit 4472e6c

Please sign in to comment.