mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Merge pull request #22512 from Microsoft/fixUseOfProcess
Do not use unguarded process in tsc.ts
This commit is contained in:
@@ -456,6 +456,7 @@ namespace ts {
|
||||
setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
|
||||
clearTimeout?(timeoutId: any): void;
|
||||
clearScreen?(): void;
|
||||
/*@internal*/ setBlocking?(): void;
|
||||
}
|
||||
|
||||
export interface FileWatcher {
|
||||
@@ -614,6 +615,11 @@ namespace ts {
|
||||
clearTimeout,
|
||||
clearScreen: () => {
|
||||
process.stdout.write("\x1Bc");
|
||||
},
|
||||
setBlocking: () => {
|
||||
if (process.stdout && process.stdout._handle && process.stdout._handle.setBlocking) {
|
||||
process.stdout._handle.setBlocking(true);
|
||||
}
|
||||
}
|
||||
};
|
||||
return nodeSystem;
|
||||
|
||||
@@ -399,8 +399,9 @@ if (ts.Debug.isDebugging) {
|
||||
if (ts.sys.tryEnableSourceMapsForHost && /^development$/i.test(ts.sys.getEnvironmentVariable("NODE_ENV"))) {
|
||||
ts.sys.tryEnableSourceMapsForHost();
|
||||
}
|
||||
declare var process: any;
|
||||
if (process && process.stdout && process.stdout._handle && process.stdout._handle.setBlocking) {
|
||||
process.stdout._handle.setBlocking(true);
|
||||
|
||||
if (ts.sys.setBlocking) {
|
||||
ts.sys.setBlocking();
|
||||
}
|
||||
|
||||
ts.executeCommandLine(ts.sys.args);
|
||||
|
||||
Reference in New Issue
Block a user