mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 20:51:43 -06:00
Merge pull request #22512 from Microsoft/fixUseOfProcess
Do not use unguarded process in tsc.ts
This commit is contained in:
commit
85df31cde4
@ -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);
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit ed149eb0c787b1195a95b44105822c64bb6eb636
|
||||
Subproject commit 40bdb4eadabc9fbed7d83e3f26817a931c0763b6
|
||||
Loading…
x
Reference in New Issue
Block a user