From f156a86024fc98e63f42c1c7acccac0af10950ef Mon Sep 17 00:00:00 2001 From: "Kevin (Kun) \"Kassimo\" Qian" Date: Tue, 25 Sep 2018 01:27:02 -0400 Subject: console.warn goes to stderr (#810) --- js/console.ts | 5 ++--- js/libdeno.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'js') diff --git a/js/console.ts b/js/console.ts index c4c36e7b2..00a24e83c 100644 --- a/js/console.ts +++ b/js/console.ts @@ -110,7 +110,7 @@ export function stringifyArgs(args: any[]): string { return out.join(" "); } -type PrintFunc = (x: string) => void; +type PrintFunc = (x: string, isErr?: boolean) => void; export class Console { constructor(private printFunc: PrintFunc) {} @@ -125,8 +125,7 @@ export class Console { // tslint:disable-next-line:no-any warn(...args: any[]): void { - // TODO Log to stderr. - this.printFunc(stringifyArgs(args)); + this.printFunc(stringifyArgs(args), true); } error = this.warn; diff --git a/js/libdeno.ts b/js/libdeno.ts index 142d779c2..8445a2d2b 100644 --- a/js/libdeno.ts +++ b/js/libdeno.ts @@ -8,7 +8,7 @@ interface Libdeno { send(msg: ArrayBufferView): null | Uint8Array; - print(x: string): void; + print(x: string, isErr?: boolean): void; setGlobalErrorHandler: ( handler: ( -- cgit v1.2.3