diff options
Diffstat (limited to 'cli/tsc')
-rw-r--r-- | cli/tsc/99_main_compiler.js | 11 | ||||
-rw-r--r-- | cli/tsc/compiler.d.ts | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index f944b21b8..b4626374d 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -34,15 +34,16 @@ delete Object.prototype.__proto__; } } + function printStderr(msg) { + core.print(msg, true); + } + function debug(...args) { if (logDebug) { const stringifiedArgs = args.map((arg) => typeof arg === "string" ? arg : JSON.stringify(arg) ).join(" "); - // adding a non-zero integer value to the end of the debug string causes - // the message to be printed to stderr instead of stdout, which is better - // aligned to the behaviour of debug messages - core.print(`DEBUG ${logSource} - ${stringifiedArgs}\n`, 1); + printStderr(`DEBUG ${logSource} - ${stringifiedArgs}\n`); } } @@ -52,7 +53,7 @@ delete Object.prototype.__proto__; ? String(arg) : JSON.stringify(arg) ).join(" "); - core.print(`ERROR ${logSource} = ${stringifiedArgs}\n`, 1); + printStderr(`ERROR ${logSource} = ${stringifiedArgs}\n`); } class AssertionError extends Error { diff --git a/cli/tsc/compiler.d.ts b/cli/tsc/compiler.d.ts index 13e6564b4..e5ce12cd3 100644 --- a/cli/tsc/compiler.d.ts +++ b/cli/tsc/compiler.d.ts @@ -36,7 +36,7 @@ declare global { // deno-lint-ignore no-explicit-any opSync<T>(name: string, params: T): any; ops(): void; - print(msg: string, code?: number): void; + print(msg: string, stderr: bool): void; registerErrorClass( name: string, Ctor: typeof Error, |