mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Remove declares in sys, core, evaluatorImpl (#53176)
This commit is contained in:
parent
e7753831e9
commit
42d23390e2
@ -2869,8 +2869,6 @@ function trimEndImpl(s: string) {
|
||||
return s.slice(0, end + 1);
|
||||
}
|
||||
|
||||
declare const process: any;
|
||||
|
||||
/** @internal */
|
||||
export function isNodeLikeSystem(): boolean {
|
||||
// This is defined here rather than in sys.ts to prevent a cycle from its
|
||||
@ -2880,7 +2878,7 @@ export function isNodeLikeSystem(): boolean {
|
||||
// when bundled using esbuild, this function will be rewritten to `__require`
|
||||
// and definitely exist.
|
||||
return typeof process !== "undefined"
|
||||
&& process.nextTick
|
||||
&& !process.browser
|
||||
&& !!process.nextTick
|
||||
&& !(process as any).browser
|
||||
&& typeof module === "object";
|
||||
}
|
||||
|
||||
@ -1443,12 +1443,6 @@ interface DirectoryWatcher extends FileWatcher {
|
||||
referenceCount: number;
|
||||
}
|
||||
|
||||
declare const require: any;
|
||||
declare const process: any;
|
||||
declare const global: any;
|
||||
declare const __filename: string;
|
||||
declare const __dirname: string;
|
||||
|
||||
// TODO: GH#18217 this is used as if it's certainly defined in many places.
|
||||
export let sys: System = (() => {
|
||||
// NodeJS detects "\uFEFF" at the start of the string and *replaces* it with the actual
|
||||
@ -1507,7 +1501,7 @@ export let sys: System = (() => {
|
||||
getAccessibleSortedChildDirectories: path => getAccessibleFileSystemEntries(path).directories,
|
||||
realpath,
|
||||
tscWatchFile: process.env.TSC_WATCHFILE,
|
||||
useNonPollingWatchers: process.env.TSC_NONPOLLING_WATCHER,
|
||||
useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
|
||||
tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
|
||||
inodeWatching: isLinuxOrMacOs,
|
||||
sysLog,
|
||||
@ -1584,7 +1578,7 @@ export let sys: System = (() => {
|
||||
disableCPUProfiler,
|
||||
cpuProfilingEnabled: () => !!activeSession || contains(process.execArgv, "--cpu-prof") || contains(process.execArgv, "--prof"),
|
||||
realpath,
|
||||
debugMode: !!process.env.NODE_INSPECTOR_IPC || !!process.env.VSCODE_INSPECTOR_OPTIONS || some(process.execArgv as string[], arg => /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(arg)),
|
||||
debugMode: !!process.env.NODE_INSPECTOR_IPC || !!process.env.VSCODE_INSPECTOR_OPTIONS || some(process.execArgv, arg => /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(arg)),
|
||||
tryEnableSourceMapsForHost() {
|
||||
try {
|
||||
(require("source-map-support") as typeof import("source-map-support")).install();
|
||||
@ -1599,8 +1593,9 @@ export let sys: System = (() => {
|
||||
process.stdout.write("\x1Bc");
|
||||
},
|
||||
setBlocking: () => {
|
||||
if (process.stdout && process.stdout._handle && process.stdout._handle.setBlocking) {
|
||||
process.stdout._handle.setBlocking(true);
|
||||
const handle = (process.stdout as any)?._handle as { setBlocking?: (value: boolean) => void };
|
||||
if (handle && handle.setBlocking) {
|
||||
handle.setBlocking(true);
|
||||
}
|
||||
},
|
||||
bufferFrom,
|
||||
|
||||
@ -5,8 +5,6 @@ import * as ts from "./_namespaces/ts";
|
||||
import * as vfs from "./_namespaces/vfs";
|
||||
import * as vpath from "./_namespaces/vpath";
|
||||
|
||||
declare let Symbol: SymbolConstructor;
|
||||
|
||||
const sourceFile = vpath.combine(vfs.srcFolder, "source.ts");
|
||||
const sourceFileJs = vpath.combine(vfs.srcFolder, "source.js");
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user