mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-29 14:04:20 -05:00
no-restricted-globals
This commit is contained in:
@@ -769,19 +769,22 @@ namespace Harness.LanguageService {
|
||||
}
|
||||
|
||||
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any {
|
||||
// tslint:disable-next-line:ban
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
return setTimeout(callback, ms, args);
|
||||
}
|
||||
|
||||
clearTimeout(timeoutId: any): void {
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
clearTimeout(timeoutId);
|
||||
}
|
||||
|
||||
setImmediate(callback: (...args: any[]) => void, _ms: number, ...args: any[]): any {
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
return setImmediate(callback, args);
|
||||
}
|
||||
|
||||
clearImmediate(timeoutId: any): void {
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
clearImmediate(timeoutId);
|
||||
}
|
||||
|
||||
|
||||
@@ -297,12 +297,15 @@ namespace Harness.Parallel.Host {
|
||||
return process.exit(2);
|
||||
}
|
||||
case "timeout": {
|
||||
if (worker.timer) clearTimeout(worker.timer);
|
||||
if (worker.timer) {
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
clearTimeout(worker.timer);
|
||||
}
|
||||
if (data.payload.duration === "reset") {
|
||||
worker.timer = undefined;
|
||||
}
|
||||
else {
|
||||
// tslint:disable-next-line:ban
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
worker.timer = setTimeout(killChild, data.payload.duration, data.payload);
|
||||
}
|
||||
break;
|
||||
@@ -624,7 +627,7 @@ namespace Harness.Parallel.Host {
|
||||
shimNoopTestInterface(global);
|
||||
}
|
||||
|
||||
// tslint:disable-next-line:ban
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
setTimeout(() => startDelayed(perfData, totalCost), 0); // Do real startup on next tick, so all unit tests have been collected
|
||||
}
|
||||
}
|
||||
|
||||
@@ -482,6 +482,7 @@ namespace ts.server {
|
||||
// so we defer until the next tick.
|
||||
//
|
||||
// Construction should finish before the next tick fires, so we do not need to do this recursively.
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
setImmediate(() => this.event(body, eventName));
|
||||
}
|
||||
};
|
||||
@@ -698,7 +699,7 @@ namespace ts.server {
|
||||
// stat due to inconsistencies of fs.watch
|
||||
// and efficiency of stat on modern filesystems
|
||||
function startWatchTimer() {
|
||||
// tslint:disable-next-line:ban
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
setInterval(() => {
|
||||
let count = 0;
|
||||
let nextToCheck = nextFileToCheck;
|
||||
@@ -881,10 +882,13 @@ namespace ts.server {
|
||||
};
|
||||
};
|
||||
|
||||
/* eslint-disable no-restricted-globals */
|
||||
sys.setTimeout = setTimeout;
|
||||
sys.clearTimeout = clearTimeout;
|
||||
sys.setImmediate = setImmediate;
|
||||
sys.clearImmediate = clearImmediate;
|
||||
/* eslint-enable no-restricted-globals */
|
||||
|
||||
if (typeof global !== "undefined" && global.gc) {
|
||||
sys.gc = () => global.gc();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user